/usr/lib/python2.7/dist-packages/registration/tests/test_views.py is in python-django-registration 2.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | """
Tests for django-registration's built-in views.
"""
from django.core.urlresolvers import reverse
from django.test import override_settings
from ..models import RegistrationProfile
from .base import RegistrationTestCase
@override_settings(ROOT_URLCONF='registration.tests.urls')
class ActivationViewTests(RegistrationTestCase):
"""
Tests for aspects of the activation view not currently exercised
by any built-in workflow.
"""
@override_settings(ACCOUNT_ACTIVATION_DAYS=7)
def test_activation(self):
"""
Activation of an account functions properly when using a
simple string URL as the success redirect.
"""
resp = self.client.post(
reverse('registration_register'),
data=self.valid_data
)
profile = RegistrationProfile.objects.get(
user__username=self.valid_data[self.user_model.USERNAME_FIELD]
)
resp = self.client.get(
reverse(
'registration_activate',
args=(),
kwargs={'activation_key': profile.activation_key}
)
)
self.assertRedirects(resp, '/')
|