Skip to content

Commit

Permalink
Add tests for accessing non existent profile
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Nov 15, 2023
1 parent 8c34b60 commit 459728e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/integration/web/alertprofiles_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ def test_profile_with_nonascii_name_should_be_saved(self, db, admin_account):

assert set_active_profile(request, profile) is None

def test_show_non_existent_profile(self, db, client):
last_alert_profile_id = getattr(AlertProfile.objects.last(), "pk", 0)
response = client.get(
path=reverse(
'alertprofiles-profile-detail', args=(last_alert_profile_id + 1,)
),
follow=True,
)

assert response.status_code == 200
assert "The requested profile does not exist." in smart_str(response.content)

def test_alertprofiles_save_profile(self, db, client):
url = reverse('alertprofiles-profile-save')
profile_name = 'Catch 22'
Expand Down

0 comments on commit 459728e

Please sign in to comment.