Skip to content

Instantly share code, notes, and snippets.

@nashmaniac
Created June 4, 2020 22:46
Show Gist options
  • Save nashmaniac/71c4ac99277d47b5cfb1187787c003b9 to your computer and use it in GitHub Desktop.
Save nashmaniac/71c4ac99277d47b5cfb1187787c003b9 to your computer and use it in GitHub Desktop.
from django.test import TestCase
from django.contrib.auth.models import User
# Create your tests here.
class UserTestCase(TestCase):
def test_user(self):
username = 'shetu'
password = 'hello'
u = User(username=username)
u.set_password(password)
u.save()
self.assertEqual(u.username, username)
self.assertTrue(u.check_password(password))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment