

def test_signup_form_only_email(self):
    '\n        Test that the form has no username field. And that the username is\n        generated in the save method\n\n        '
    valid_data = {
        'email': 'hans@gretel.com',
        'password1': 'blowfish',
        'password2': 'blowfish',
    }
    form = forms.SignupFormOnlyEmail(data=valid_data)
    self.assertFalse(form.fields.get('username', False))
    self.assertTrue(form.is_valid())
    user = form.save()
    self.assertTrue(len(user.username), 5)

dataset/ETHPy150Open bread-and-pepper/django-userena/userena/tests/tests_forms.py SignupFormOnlyEmailTests.test_signup_form_only_email/original