Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
tiina303 committed Jan 4, 2024
1 parent b166d2a commit 7215058
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions posthog/api/test/test_instance_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ def test_non_staff_user_cant_list_or_retrieve(self):
)

def test_update_setting(self):
response = self.client.get(f"/api/instance_settings/EMAIL_ENABLED")
response = self.client.get(f"/api/instance_settings/PERSON_ON_EVENTS_ENABLED")
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.json()["value"], True)
self.assertEqual(response.json()["value"], False)

response = self.client.patch(f"/api/instance_settings/EMAIL_ENABLED", {"value": False})
response = self.client.patch(f"/api/instance_settings/PERSON_ON_EVENTS_ENABLED", {"value": True})
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.json()["value"], False)
self.assertEqual(response.json()["value"], True)

self.assertEqual(get_instance_setting_helper("EMAIL_ENABLED").value, False)
self.assertEqual(get_instance_setting("EMAIL_ENABLED"), False)
self.assertEqual(get_instance_setting_helper("PERSON_ON_EVENTS_ENABLED").value, True)
self.assertEqual(get_instance_setting("PERSON_ON_EVENTS_ENABLED"), True)

def test_updating_email_settings(self):
set_instance_setting("EMAIL_HOST", "localhost")
Expand Down

0 comments on commit 7215058

Please sign in to comment.