Skip to content

Instantly share code, notes, and snippets.

@joshtrigger
Created November 20, 2018 10:37
Show Gist options
  • Save joshtrigger/6c0217cec35e2c01849a3760c858511a to your computer and use it in GitHub Desktop.
Save joshtrigger/6c0217cec35e2c01849a3760c858511a to your computer and use it in GitHub Desktop.
from django.test import Client, TestCase
class TestLogin(TestCase):
def setUp(self):
self.client = Client()
self.data = {
'username' : 'joshua',
'email' : 'joshua@me.com',
'password' : 'qwerty'
}
def test_login_user(self):
"""test user login with correct credentials"""
response = self.client.post('users/login', self.data)
self.assertEqual(response.status_code, 200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment