I have a Django application and the custom user - want to test it (do unit testing). My custom user is emailuser, which consists of e-mail and password fields. I want to set up something of such national mplayer, give it a field and a password. But my code below does not work.
settings.py
AUTH_USER_MODEL = 'custom_user.EmailUser'
My code in test.py
from django.test import TestCase
from django.conf import settings
class MyTest(TestCase):
def setUp(self):
self.user = settings.AUTH_USER_MODEL.objects.create('testuser@test.pl', 'testpass')
def test_user(self):
self.assertEqual(self.user, 'testuser@test.pl')