Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django import test
- from django.utils.translation import ugettext as _
- from django.core import mail
- from appname.models import User
- from appname.tests.decorators import as_guest, signed_as
- from appname.tests.mixins import AuthMixin
- class ViewsAuthSignupTest(AuthMixin, test.TestCase):
- fixtures = ['test_data']
- # ...
- @signed_as('jeffrey.mercer@example.com')
- def test_signup_creates_user_with_groups(self):
- response = self.client.post('/auth/signup/', {
- 'name': 'Jack Smith',
- 'tax_code': 'JCKSMT91T31L781A',
- 'email': 'jack.smith@example.com',
- 'groups': # what here?
- }, follow = True)
- self.assertRedirects(response, '/')
- user = User.objects.get(email = 'jack.smith@example.com')
- self.assertEqual(user.groups.all().count(), 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement