#1796: [patch] "Cannot resolve keyword ___ into field" error when working with
ManyToMany relation
-------------------------+--------------------------------------------------
   Reporter:  anonymous  |                Owner:  mtredinnick     
     Status:  reopened   |            Component:  Database wrapper
    Version:  SVN        |           Resolution:                  
   Keywords:             |                Stage:  Accepted        
  Has_patch:  1          |           Needs_docs:  0               
Needs_tests:  0          |   Needs_better_patch:  0               
-------------------------+--------------------------------------------------
Comment (by mtredinnick):

 Fixing the wiki formatting from the last ticket so that it's readable:
 {{{
 #!python
 from django.contrib.auth.models import User,Group import datetime, random,
 sha import unittest
 
 class ProfileTest?(unittest.TestCase?):
 
     """ Used as a test case for what appears as this bug :
 http://code.djangoproject.com/ticket/1796 """
 
     def setUp(self):
 
         self.salt = sha.new(str(random.random())).hexdigest()[:5]
 
     def testAcctCreate(self):
 
         self.u=User(
 
             first_name='bob', last_name='jones', username='bjones',
 email='[EMAIL PROTECTED]', # is_staff=True,
 
         )
         self.u.set_password('[EMAIL PROTECTED]')
         self.u.save()
         self.group=Group(name='Test Group')
         self.group.save()
         self.u.groups.add(self.group)
         self.assertEquals(User.objects.get(username='bjones'), self.u)
         self.assertEquals(Group.objects.get(name='Test Group'),
 self.group)
         print self.u.dict print self.u.groups.all()
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/1796#comment:67>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to