Skip to content

Commit

Permalink
Add test for claiming an already claimed callsign
Browse files Browse the repository at this point in the history
  • Loading branch information
elnappo committed Apr 3, 2019
1 parent e302cef commit 4591702
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions project_novis/callsign/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ def test_callsign_permissions(self):
response = self.client.get(reverse('callsign:callsign-html-update', kwargs={"slug": callsigns[1]}))
self.assertEqual(response.status_code, 403)

with self.subTest('Second user login'):
get_user_model().objects.create_user(email="bob@project-novis.org", password="top_secret")
logged_in = self.client.login(username="bob@project-novis.org", password="top_secret")
self.assertTrue(logged_in)

with self.subTest('POST callsign claim to already claimed callsign'):
response = self.client.post(reverse('callsign:callsign-html-claim', kwargs={"slug": callsigns[0]}))
self.assertEqual(response.status_code, 403)

def test_views_anonymous(self):
callsigns = ("DF0HSA",)
views = (
Expand Down

0 comments on commit 4591702

Please sign in to comment.