Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. from django                     import test
  2. from django.utils.translation   import ugettext as _
  3. from django.core                import mail
  4. from appname.models             import User
  5. from appname.tests.decorators   import as_guest, signed_as
  6. from appname.tests.mixins       import AuthMixin
  7.  
  8. class ViewsAuthSignupTest(AuthMixin, test.TestCase):
  9.  
  10.     fixtures = ['test_data']
  11.  
  12.     # ...
  13.  
  14.     @signed_as('jeffrey.mercer@example.com')
  15.     def test_signup_creates_user_with_groups(self):
  16.         response = self.client.post('/auth/signup/', {
  17.             'name': 'Jack Smith',
  18.             'tax_code': 'JCKSMT91T31L781A',
  19.             'email': 'jack.smith@example.com',
  20.             'groups': # what here?
  21.         }, follow = True)
  22.         self.assertRedirects(response, '/')
  23.         user = User.objects.get(email = 'jack.smith@example.com')
  24.         self.assertEqual(user.groups.all().count(), 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement