Skip to content

Commit

Permalink
Add tests for posting filter with event types
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Sep 27, 2023
1 parent fd3373b commit bb98af8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/notificationprofile/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,26 @@ def test_should_create_filter_with_valid_values(self):
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertTrue(Filter.objects.filter(pk=response.data["pk"]).exists())

def test_should_create_filter_with_event_types(self):
filter_name = "test-filter"
response = self.user1_rest_client.post(
path=self.ENDPOINT,
data={
"name": filter_name,
"filter": {
"event_types": [
"STA",
"END",
"CLO",
"REO",
"OTH",
]
},
},
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertTrue(Filter.objects.filter(pk=response.data["pk"]).exists())

def test_should_update_filter_name_with_valid_values(self):
filter1_pk = self.filter1.pk
filter1_path = f"{self.ENDPOINT}{filter1_pk}/"
Expand Down

0 comments on commit bb98af8

Please sign in to comment.