def test_expired_activation(self):
        new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(),
                                                                    **self.user_info)
        new_user.date_joined -= datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS + 1)
        new_user.save()

        profile = RegistrationProfile.objects.get(user=new_user)
        activated = RegistrationProfile.objects.activate_user(profile.activation_key)

        self.failIf(isinstance(activated, User))
        self.failIf(activated)

        new_user = User.objects.get(username='alice')
        self.failIf(new_user.is_active)

        profile = RegistrationProfile.objects.get(user=new_user)
        self.assertNotEqual(profile.activation_key, RegistrationProfile.ACTIVATED)
Compile a prep file to a pyc file.  Optionally, keep the python source too.
dataset/ETHPy150Open codesters/codesters/registration/tests/models.py/RegistrationModelTests.test_expired_activation--crossover with--dataset/ETHPy150Open CGATOxford/cgat/obsolete/preppy.py/compileModule