duplicated question

https://groups.google.com/forum/#!topic/django-users/I4wmYKNMNn8


On Thu, Jul 3, 2014 at 9:09 AM, Pepsodent Cola <pepsodentc...@gmail.com>
wrote:

> I want to run a unit test for a user logging in but I get error.  What am
> I doing wrong?
>
>
> from django.test import TestCase
> from userprofile.models import UserProfile
> from django.contrib.auth.models import User
>
> class UserProfileTest(TestCase):
>     # User factory method
>     def create_user(self, username='joe', password='joe'):
>         return User.objects.create(username=username, password=password)
>
>     # Create User
>     def test_creation_USER(self):
>         u = self.create_user()
>         self.assertTrue(isinstance(u, User))
>         login = self.client.login(username='joe', password='joe')
> *        self.assertEqual(login, True)*
>
> ======================================================================
> FAIL: test_creation_USER (userprofile.tests.UserProfileTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/home/Django/project/userprofile/tests.py", line 44, in
> test_creation_USER
>     self.assertEqual(login, True)
> *AssertionError: False != True*
>
> ----------------------------------------------------------------------
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5d49c776-fe1f-4702-abc1-d2c99468d82a%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/5d49c776-fe1f-4702-abc1-d2c99468d82a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

*AMIM KNABBEN*
+55 48 9680 9126 (m)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAODc%2BXaWUytkQGo1PCrRkE4zLzc-TM0P4cdC%3Dxf8bK8%3DCMNgPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to