diff --git a/end_of_month/test/test_end_of_month_process.py b/end_of_month/test/test_end_of_month_process.py index 62ed9a8d..6c8f80aa 100644 --- a/end_of_month/test/test_end_of_month_process.py +++ b/end_of_month/test/test_end_of_month_process.py @@ -150,17 +150,15 @@ def check_archive_period(self, tested_period): end_of_month_archive(tested_period) # run a query giving the full total archived_total = self.get_period_total(tested_period) - self.assertEqual(total_before, archived_total) + assert total_before == archived_total change_amount = tested_period * 10000 self.init_data.monthly_figure_update(tested_period + 1, change_amount) current_total = self.get_current_total() self.archived_figure[tested_period] = archived_total - self.assertNotEqual(current_total, archived_total) - self.assertEqual(current_total, (archived_total + change_amount)) + assert current_total != archived_total + assert current_total == (archived_total + change_amount) for period in range(1, tested_period + 1): - self.assertEqual( - self.archived_figure[period], self.get_period_total(period) - ) + assert self.archived_figure[period] == self.get_period_total(period) # The following tests check that the archived figures are not changed by # changing the current figures. @@ -351,23 +349,20 @@ def check_archive_period(self, tested_period): end_of_month_archive(tested_period) # run a query giving the full total archived_total = self.get_period_budget_total(tested_period) - self.assertEqual(total_before, archived_total) + assert total_before == archived_total change_amount = tested_period * 10000 self.init_data.monthly_figure_update(tested_period + 1, change_amount, "budget") current_total = self.get_current_budget_total() self.archived_figure[tested_period] = archived_total - self.assertNotEqual(current_total, archived_total) - self.assertNotEqual(current_total, archived_total) - self.assertEqual(current_total, (archived_total + change_amount)) + assert current_total != archived_total + assert current_total == (archived_total + change_amount) for period in range(1, tested_period + 1): # Check the full total. It is saved in a different table, for convenience monthly_budget = MonthlyTotalBudget.objects.get(archived_period=period) - self.assertEqual(self.archived_figure[period], monthly_budget.amount) + assert self.archived_figure[period], monthly_budget.amount) # Check that nothig has corrupted the archived figures - self.assertEqual( - self.archived_figure[period], self.get_period_budget_total(period) - ) + assert self.archived_figure[period] == self.get_period_budget_total(period) # The following tests check that the archived figures are not changed by # changing the current figures. diff --git a/end_of_month/test/test_outturn_variance.py b/end_of_month/test/test_outturn_variance.py index 8343f231..a0c5a9b0 100644 --- a/end_of_month/test/test_outturn_variance.py +++ b/end_of_month/test/test_outturn_variance.py @@ -50,17 +50,17 @@ def check_archive_period(self, tested_period): end_of_month_archive(tested_period, True) # run a query giving the full total archived_total = self.get_period_total(tested_period) - self.assertEqual(total_before, archived_total) + assert total_before == archived_total previous_outurn = self.get_current_previous_outturn() - self.assertEqual(total_before, previous_outurn) + assert total_before == previous_outurn change_amount = tested_period * 10000 self.init_data.monthly_figure_update(tested_period + 1, change_amount) current_total = self.get_current_total() self.archived_figure[tested_period] = archived_total - self.assertNotEqual(current_total, previous_outurn) - self.assertEqual(current_total, (previous_outurn + change_amount)) + assert current_total != previous_outurn + assert current_total == (previous_outurn + change_amount) # The following tests check that the previous outturn figure is not changed by # changing the current figures.