def test_activation_nonexistent_key(self):
"""
Attempting to activate with a non-existent key (i.e., one not
associated with any account) fails.
"""
# Due to the way activation keys are constructed during
# registration, this will never be a valid key.
invalid_key = hashlib.sha1(six.b('foo')).hexdigest()
self.failIf(RegistrationProfile.objects.activate_user(invalid_key))
评论列表
文章目录