Commit 9fcb9c0c8dc92156d8a89fb1e10d9f6226905df0

Authored by smithumble
1 parent 609366b0

Fix fake amounts for tendering contract amountNet tests

... ... @@ -45,19 +45,21 @@ def get_fake_funder_scheme():
45 45
46 46
47 47 def create_fake_amount(award_amount, value_added_tax_included=False):
48   - half_min_amount_net = award_amount - award_amount * 0.2
  48 + min_amount_net = award_amount - award_amount * 0.2
  49 + range_amount_net = award_amount - min_amount_net
  50 + half_min_amount_net = min_amount_net + range_amount_net / 2
  51 + half_max_amount_net = half_min_amount_net + range_amount_net
49 52 if value_added_tax_included:
50 53 return round(random.uniform(half_min_amount_net, award_amount), 2)
51 54 else:
52   - min_amount_net = award_amount - award_amount * 0.2
53   - range_amount_net = award_amount - min_amount_net
54   - return round(random.uniform(award_amount, award_amount + range_amount_net / 2), 2)
  55 + return round(random.uniform(award_amount, half_max_amount_net), 2)
55 56
56 57
57 58 def create_fake_amount_net(award_amount, value_added_tax_included=False):
58   - half_min_amount_net = award_amount - award_amount * 0.2
  59 + min_amount_net = award_amount - award_amount * 0.2
  60 + range_amount_net = award_amount - min_amount_net
  61 + half_min_amount_net = min_amount_net + range_amount_net / 2
59 62 if value_added_tax_included:
60   - min_amount_net = award_amount - award_amount * 0.2
61 63 return round(random.uniform(min_amount_net, half_min_amount_net), 2)
62 64 else:
63 65 return round(random.uniform(half_min_amount_net, award_amount), 2)
... ...
Please register or login to post a comment