From 3c9b5a4c19ac2d558726d588d44fc886868c1cbd Mon Sep 17 00:00:00 2001 From: Marc Date: Mon, 15 Sep 2014 12:21:56 +0000 Subject: [PATCH] Billing --- .../apps/orders/tests/functional_tests/tests.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/orchestra/apps/orders/tests/functional_tests/tests.py b/orchestra/apps/orders/tests/functional_tests/tests.py index 0274d2de..31f639be 100644 --- a/orchestra/apps/orders/tests/functional_tests/tests.py +++ b/orchestra/apps/orders/tests/functional_tests/tests.py @@ -259,12 +259,18 @@ class OrderTests(BaseTestCase): groups = [] prev = None for rate in rates: - elif not prev or (not rate.is_combinable and prev.plan != rate.plan): - groups.append([rate]) - else: - groups[-1].append(rate) + if rate.quantity <= metric: + if not prev or (not rate.is_combinable and prev.plan != rate.plan): + groups.append([rate]) + else: + groups[-1].append(rate) + results = [] for group in groups: - for rates in group: + ini = None + for rate in group: + if not ini: + ini = rate.quantity + return result