Make sure PATCH endpoint behaves as expected for quota.

fix #3668
This commit is contained in:
Antoine Nguyen
2025-08-07 16:34:43 +02:00
parent 13f6100f6b
commit a187f1cc80
2 changed files with 25 additions and 13 deletions
+10
View File
@@ -331,6 +331,16 @@ class AccountViewSetTestCase(ModoAPITestCase):
resp = self.client.patch(url, data, format="json")
self.assertEqual(resp.status_code, 200)
def test_update_quota(self):
account = core_models.User.objects.get(username="user@test.com")
url = reverse("v2:account-detail", args=[account.pk])
data = {
"mailbox": {"quota": 1},
}
resp = self.client.patch(url, data, format="json")
self.assertEqual(resp.status_code, 200)
self.assertEqual(account.mailbox.quota, data["mailbox"]["quota"])
def test_user_updates_password(self):
account = core_models.User.objects.get(username="user@test.com")
self.authenticate_user(account)