From 2f71246509217bb2031572bd5f40c23206791aba Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Thu, 30 Jun 2022 12:15:09 +0200 Subject: [PATCH] assertDictContainsSubset is deprecated --- kfet/tests/test_views.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kfet/tests/test_views.py b/kfet/tests/test_views.py index c6d8a5a7..d09ff3e8 100644 --- a/kfet/tests/test_views.py +++ b/kfet/tests/test_views.py @@ -703,7 +703,7 @@ class AccountStatOperationListViewTests(ViewTestCaseMixin, TestCase): for stat, expected in zip(content["stats"], expected_stats): expected_url = expected.pop("url") self.assertUrlsEqual(stat["url"], expected_url) - self.assertDictContainsSubset(expected, stat) + self.assertEqual(stat, {**stat, **expected}) class AccountStatOperationViewTests(ViewTestCaseMixin, TestCase): @@ -812,7 +812,7 @@ class AccountStatBalanceListViewTests(ViewTestCaseMixin, TestCase): for stat, expected in zip(content["stats"], expected_stats): expected_url = expected.pop("url") self.assertUrlsEqual(stat["url"], expected_url) - self.assertDictContainsSubset(expected, stat) + self.assertEqual(stat, {**stat, **expected}) class AccountStatBalanceViewTests(ViewTestCaseMixin, TestCase): @@ -1647,7 +1647,7 @@ class ArticleStatSalesListViewTests(ViewTestCaseMixin, TestCase): for stat, expected in zip(content["stats"], expected_stats): expected_url = expected.pop("url") self.assertUrlsEqual(stat["url"], expected_url) - self.assertDictContainsSubset(expected, stat) + self.assertEqual(stat, {**stat, **expected}) class ArticleStatSalesViewTests(ViewTestCaseMixin, TestCase): @@ -1716,7 +1716,7 @@ class KPsulCheckoutDataViewTests(ViewTestCaseMixin, TestCase): expected = {"name": "Checkout", "balance": "10.00"} - self.assertDictContainsSubset(expected, content) + self.assertEqual(content, {**content, **expected}) self.assertSetEqual( set(content.keys()), @@ -4100,7 +4100,7 @@ class KPsulArticlesData(ViewTestCaseMixin, TestCase): ] for expected, article in zip(expected_list, articles): - self.assertDictContainsSubset(expected, article) + self.assertEqual(article, {**article, **expected}) self.assertSetEqual( set(article.keys()), set( @@ -4200,7 +4200,7 @@ class AccountReadJSONViewTests(ViewTestCaseMixin, TestCase): content = json.loads(r.content.decode("utf-8")) expected = {"name": "first last", "trigramme": "000", "balance": "0.00"} - self.assertDictContainsSubset(expected, content) + self.assertEqual(content, {**content, **expected}) self.assertSetEqual( set(content.keys()),