Commits

Julian Scott committed ac1f2b0 Draft

Use TemplateView instead of direct_to_template

  • Participants
  • Parent commits ed241e2
  • Branches cbv

Comments (0)

Files changed (1)

registration/tests/urls.py

 """
 
 from django.conf.urls.defaults import *
-from django.views.generic.simple import direct_to_template
+from django.views.generic import TemplateView
 
 from registration.views import activate
 from registration.views import register
                        # Set up a pattern which will correspond to the
                        # custom 'disallowed_url' above.
                        url(r'^custom-disallowed/$',
-                           direct_to_template,
-                           {'template': 'registration/registration_closed.html'},
+                           TemplateView.as_view(template_name='registration/registration_closed.html'),
                            name='registration_test_custom_disallowed'),
                        # Test the 'register' view with custom redirect
                        # on successful registration.
                            ),
                        # Pattern for custom redirect set above.
                        url(r'^custom-success/$',
-                           direct_to_template,
-                           {'template': 'registration/test_template_name.html'},
+                           TemplateView.as_view(template_name='registration/test_template_name.html'),
                            name='registration_test_custom_success_url'),
                        (r'', include('registration.backends.default.urls')),
                        )