Saturday, November 23, 2013

Re: django tests

Now my code is this:
class UserProfileTestCase(TestCase):
def setUp(self):
self.userprofile = UserProfile.objects.filter(user_id =
1).update(first_name = "Harjot")

def test_profile(self):
self.assertEqual(self.userprofile.user_id, 1)
and I am getting this error:
Traceback (most recent call last):
File "/home/harjot/Automation/../Automation/tcc/tests.py", line 20,
in test_profile
self.assertEqual(self.userprofile.user_id, 1)
AttributeError: 'int' object has no attribute 'user_id'

On Sat, Nov 23, 2013 at 2:08 PM, Harjot Mann <harjotmann1992@gmail.com> wrote:
> On Sat, Nov 23, 2013 at 7:53 AM, Arun K Reddy <arunkiitm@gmail.com> wrote:
>> add any other not optional fields. Hope it works.
>
>
> Same error. Even on adding
> from django.contrib.auth import User
> Import error is giving.
>
> --
> Harjot Kaur Mann
> Blog: http://harjotmann.wordpress.com/
> Daily Dairy: http://harjotmann.wordpress.com/daily-diary/



--
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/
Daily Dairy: http://harjotmann.wordpress.com/daily-diary/

--
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+unsubscribe@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/CAB0GQhAALSzA3bEAP5v6rqGNxkHrBNqGLknFNcKigFj-NZUEhA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate