

def test_valid_activation(self):
    '\n        Activating a user within the permitted window makes the\n        account active, and resets the activation key.\n        \n        '
    new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), **self.user_info)
    profile = RegistrationProfile.objects.get(user=new_user)
    activated = RegistrationProfile.objects.activate_user(profile.activation_key)
    self.failUnless(isinstance(activated, User))
    self.assertEqual(activated.id, new_user.id)
    self.failUnless(activated.is_active)
    profile = RegistrationProfile.objects.get(user=new_user)
    self.assertEqual(profile.activation_key, RegistrationProfile.ACTIVATED)

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