From 05b4b18eeb82312da11630e4d4f1362549182ec3 Mon Sep 17 00:00:00 2001 From: Tim White Date: Mon, 25 Mar 2024 11:30:55 -0600 Subject: [PATCH] Update tests for Django 4. --- termsandconditions/tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/termsandconditions/tests.py b/termsandconditions/tests.py index 5e8a9d10..cb69aa8f 100644 --- a/termsandconditions/tests.py +++ b/termsandconditions/tests.py @@ -98,13 +98,13 @@ def test_get_active_terms_list(self): """Test get list of active T&Cs""" active_list = TermsAndConditions.get_active_terms_list() self.assertEqual(2, len(active_list)) - self.assertQuerysetEqual(active_list, [repr(self.terms3), repr(self.terms2)]) + self.assertQuerySetEqual(active_list, [self.terms3, self.terms2]) def test_get_active_terms_not_agreed_to(self): """Test get T&Cs not agreed to""" active_list = TermsAndConditions.get_active_terms_not_agreed_to(self.user1) self.assertEqual(2, len(active_list)) - self.assertQuerysetEqual(active_list, [repr(self.terms3), repr(self.terms2)]) + self.assertQuerySetEqual(active_list, [self.terms3, self.terms2]) def test_user_is_excluded(self): """Test user3 has perm which excludes them from having to accept T&Cs""" @@ -115,14 +115,14 @@ def test_superuser_is_not_implicitly_excluded(self): """Test su should have to accept T&Cs even if they are superuser but don't explicitly have the skip perm""" active_list = TermsAndConditions.get_active_terms_not_agreed_to(self.su) self.assertEqual(2, len(active_list)) - self.assertQuerysetEqual(active_list, [repr(self.terms3), repr(self.terms2)]) + self.assertQuerySetEqual(active_list, [self.terms3, self.terms2]) def test_superuser_cannot_skip(self): """Test su still has to accept even if they are explicitly given the skip perm""" self.su.user_permissions.add(self.skip_perm) active_list = TermsAndConditions.get_active_terms_not_agreed_to(self.su) self.assertEqual(2, len(active_list)) - self.assertQuerysetEqual(active_list, [repr(self.terms3), repr(self.terms2)]) + self.assertQuerySetEqual(active_list, [self.terms3, self.terms2]) def test_superuser_excluded(self): """Test su doesn't have to accept with TERMS_EXCLUDE_SUPERUSERS set"""