

def test_profile_creation(self):
    '\n        Creating a registration profile for a user populates the\n        profile with the correct user and a SHA1 hash to use as\n        activation key.\n        \n        '
    new_user = User.objects.create_user(**self.user_info)
    profile = RegistrationProfile.objects.create_profile(new_user)
    self.assertEqual(RegistrationProfile.objects.count(), 1)
    self.assertEqual(profile.user.id, new_user.id)
    self.failUnless(re.match('^[a-f0-9]{40}$', profile.activation_key))
    self.assertEqual(unicode(profile), 'Registration information for alice')

dataset/ETHPy150Open codesters/codesters/registration/tests/models.py RegistrationModelTests.test_profile_creation/original