Add API key reset test.

This commit is contained in:
Christopher Charbonneau Wells 2017-12-05 10:53:28 -05:00
parent a9c0757b4d
commit 2f21e3d7f4
1 changed files with 9 additions and 0 deletions

View File

@ -48,6 +48,15 @@ class ViewsTestCase(TestCase):
page = self.c.get('/')
self.assertEqual(page.url, '/dashboard/')
def test_user_reset_api_key(self):
api_key_before = User.objects.get(pk=self.user.id).settings.api_key()
page = self.c.get('/user/reset-api-key/')
self.assertEqual(page.status_code, 302)
self.assertNotEqual(
api_key_before,
User.objects.get(pk=self.user.id).settings.api_key()
)
def test_user_settings(self):
page = self.c.get('/user/settings/')
self.assertEqual(page.status_code, 200)