Hi
I have tried numerous ways to login through client() but it keeps
returning false.
I have tested it in the shell and it works fine and returns
login=true.
But in my tests.py file, it keeps failing the test because it keeps
returning login=false.
Here is my script:
"""
from django.test import TestCase
from django.test.client import Client
class AuthorisedUserTests(TestCase):
def setUp(self):
self.client = Client()
def test_login_returns_True(self):
response = self.client.login(username='auser',
password='apassword')
self.failUnlessEqual(response, True)
"""
I have used Djangos inbuilt user authorisation through the use of
"from django.contrib.auth.models import User". I am also using
decorators.
Where am I going wrong?
Thanks in advance,
Tony
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---