python - Can't login with django's test client -


i have following code in tests.py

class testadding(testcase):      def setup(self):         username = 'testuser'         password = 'testpass'         user = user.objects.create_user(username, password=password)         self.client = client()         logged_in = self.client.login(username=username, password=password)         self.asserttrue(logged_in) 

i following error

$ ./manage.py test --settings=quotes.settings_dev creating test database alias 'default'...  e ====================================================================== error: test_add (webapp.tests.testadding) ---------------------------------------------------------------------- traceback (most recent call last):   file "/home/mahmoud/projects/quotes/webapp/tests.py", line 15, in setup     self.asserttrue(logged_in) assertionerror: false not true  ---------------------------------------------------------------------- ran 1 test in 0.137s  failed (errors=1) destroying test database alias 'default'... 

i checked see whether user created, , does.

the problem logging in.

edit: these parts of settings file might relevant.

authentication_backends = (     'django.contrib.auth.backends.modelbackend',     'allauth.account.auth_backends.authenticationbackend',     'guardian.backends.objectpermissionbackend', )  account_authentication_method = 'username' 


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

sql - Duplicate Column name error while executing mysql query? -