mirror of https://github.com/snachodog/mybuddy.git
Add API key reset test.
This commit is contained in:
parent
a9c0757b4d
commit
2f21e3d7f4
|
@ -48,6 +48,15 @@ class ViewsTestCase(TestCase):
|
||||||
page = self.c.get('/')
|
page = self.c.get('/')
|
||||||
self.assertEqual(page.url, '/dashboard/')
|
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):
|
def test_user_settings(self):
|
||||||
page = self.c.get('/user/settings/')
|
page = self.c.get('/user/settings/')
|
||||||
self.assertEqual(page.status_code, 200)
|
self.assertEqual(page.status_code, 200)
|
||||||
|
|
Loading…
Reference in New Issue