Skip to content

Commit

Permalink
[chore] Use full_clean instead of saving directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhanus3133 committed Sep 20, 2024
1 parent c3f01e5 commit ad8ff56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions openwisp_notifications/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def test_notification_preferences_button_staff_user(self):
# Button does not appear for non-staff user
with self.subTest("Button should not appear for non-staff user"):
user.is_staff = False
user.full_clean()
user.save()
response = self.client.get(user_admin_page)
self.assertNotContains(response, expected_html, html=True)
Expand Down
2 changes: 2 additions & 0 deletions openwisp_notifications/tests/test_notification_setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ def test_global_notification_setting_update(self):
# Update global settings
global_setting.email = False
global_setting.web = False
global_setting.full_clean()
global_setting.save()

with self.subTest(
Expand All @@ -298,6 +299,7 @@ def test_global_notification_setting_update(self):
).update(email=True)

global_setting.web = True
global_setting.full_clean()
global_setting.save()

self.assertTrue(
Expand Down

0 comments on commit ad8ff56

Please sign in to comment.