diff --git a/authentication/tests.py b/authentication/tests.py index d81b4b4..21760b2 100644 --- a/authentication/tests.py +++ b/authentication/tests.py @@ -5,6 +5,7 @@ REGISTER_LINK = reverse('authentication:register') LOGIN_LINK = reverse('authentication:login') +LOGOUT_LINK = reverse('authentication:logout') class RegisterTest(TestCase): @@ -68,4 +69,15 @@ def testLoginFailed(self): data = {'username': 'testuser', 'password': 'testwrongpassword'} response = self.client.post(LOGIN_LINK, json.dumps(data), content_type='application/json') self.assertEqual(response.status_code, 400) - self.assertEqual(response.json()['msg'],"Wrong username/password!") \ No newline at end of file + self.assertEqual(response.json()['msg'],"Wrong username/password!") + +class LogoutTest(TestCase): + def setUp(self): + self.client = Client() + self.user = AppUser.objects.create_user(email='email@email.com',username='testuser',password='test') + self.client.login(username = 'testuser', password = 'test') + + def logoutTest(self): + response = self.client.post(LOGOUT_LINK) + self.assertEqual(response.status_code, 200) + \ No newline at end of file