Fixed tests

This commit is contained in:
Antoine Nguyen
2025-09-23 10:10:51 +02:00
parent 1157fe9ff1
commit 524df061c0
2 changed files with 4 additions and 4 deletions
+2 -4
View File
@@ -72,8 +72,7 @@ class ViewsTestCase(TestDataMixin, ModoAPITestCase):
def test_user_settings(self):
"""Check that remote collection creation request is sent."""
# 1. Addressbook with contacts must be synced manually
data = {"username": self.user.username, "password": "toto"}
self.client.post(reverse("core:login"), data)
self.client.force_authenticate(self.user)
self.enable_cdav_sync()
self.addressbook.refresh_from_db()
self.assertIs(self.addressbook.last_sync, None)
@@ -81,8 +80,7 @@ class ViewsTestCase(TestDataMixin, ModoAPITestCase):
# 2. Addressbook with no contacts can be considered synced
user = core_models.User.objects.get(username="user@test2.com")
abook = user.addressbook_set.first()
data = {"username": user.username, "password": "toto"}
self.client.post(reverse("core:login"), data)
self.client.force_authenticate(user)
abook.refresh_from_db()
self.assertIs(abook.last_sync, None)
# Now enable sync.
+2
View File
@@ -158,6 +158,8 @@ class ProfileTestCase(LDAPTestCaseMixin, ModoAPITestCase):
username = "testuser@example.com"
self.authenticate(username, "test")
user = models.User.objects.get(username=username)
self.client.force_authenticate(user)
response = self.client.post(
reverse("v2:account-set-me-password"),
{"password": "test", "new_password": "Toto1234"},