Last active
September 18, 2018 12:49
-
-
Save MuhanguziDavid/5b0b10f5b83ade05a41c446f22df7c13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from authors.apps.authentication.models import User | |
from django.test import TestCase | |
from rest_framework import status | |
class LoginTest(TestCase): | |
def setUp(self): | |
self.user = User(email = "[email protected]", username = "davie", password = "12345678") | |
self.user.save() | |
def test_login_without_password(self): | |
response = self.client.post('users/login', data=dict(email="[email protected]", password = "")) | |
return self.assertIn("A password is required to log in.", str(response.data)) | |
return self.assertEqual(request.status_code, status.HTTP_400_BAD_REQUEST) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment