Commits

Douglas Kastle committed beffd69 Draft

Made all the changes so far to run against Django==1.5c1, still fails two tests un sure why and may not be in final release

  • Participants
  • Parent commits 27bccd1

Comments (0)

Files changed (13)

 dist
 MANIFEST
 _build
-_static
+_static
+testdjangoregistration/
+dev.sqlite
+manage.py

File registration/backends/default/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
 
 urlpatterns = patterns('',
                        url(r'^activate/complete/$',
-                           direct_to_template,
-                           {'template': 'registration/activation_complete.html'},
+                           TemplateView.as_view(template_name='registration/activation_complete.html'),
                            name='registration_activation_complete'),
                        # Activation keys get matched by \w+ instead of the more specific
                        # [a-fA-F0-9]{40} because a bad activation key should still get to the view;
                            {'backend': 'registration.backends.default.DefaultBackend'},
                            name='registration_register'),
                        url(r'^register/complete/$',
-                           direct_to_template,
-                           {'template': 'registration/registration_complete.html'},
+                           TemplateView.as_view(template_name='registration/registration_complete.html'),
                            name='registration_complete'),
                        url(r'^register/closed/$',
-                           direct_to_template,
-                           {'template': 'registration/registration_closed.html'},
+                           TemplateView.as_view(template_name='registration/registration_closed.html'),
                            name='registration_disallowed'),
                        (r'', include('registration.auth_urls')),
                        )

File registration/backends/simple/__init__.py

 from django.conf import settings
 from django.contrib.auth import authenticate
 from django.contrib.auth import login
-from django.contrib.auth.models import User
+try:
+    from django.contrib.auth import get_user_model
+except ImportError: # django < 1.5
+    from django.contrib.auth.models import User
+else:
+    User = get_user_model()
+
 
 from registration import signals
 from registration.forms import RegistrationForm

File registration/backends/simple/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
                            {'backend': 'registration.backends.simple.SimpleBackend'},
                            name='registration_register'),
                        url(r'^register/closed/$',
-                           direct_to_template,
-                           {'template': 'registration/registration_closed.html'},
+                           TemplateView.as_view(template_name='registration/registration_closed.html'),
                            name='registration_disallowed'),
                        (r'', include('registration.auth_urls')),
                        )

File registration/forms.py

 """
 
 
-from django.contrib.auth.models import User
+try:
+    from django.contrib.auth import get_user_model
+except ImportError: # django < 1.5
+    from django.contrib.auth.models import User
+else:
+    User = get_user_model()
+
 from django import forms
 from django.utils.translation import ugettext_lazy as _
 

File registration/models.py

 import re
 
 from django.conf import settings
-from django.contrib.auth.models import User
+try:
+    from django.contrib.auth import get_user_model
+except ImportError: # django < 1.5
+    from django.contrib.auth.models import User
+else:
+    User = get_user_model()
+
 from django.db import models
 from django.db import transaction
 from django.template.loader import render_to_string

File registration/tests/__init__.py

         """
         versions = [
             {'version': (1, 0, 0, 'alpha', 0),
-             'expected': "1.0 pre-alpha"},
+             'expected': "1.0"},
             {'version': (1, 0, 1, 'alpha', 1),
-             'expected': "1.0.1 alpha 1"},
+             'expected': "1.0.1a1"},
             {'version': (1, 1, 0, 'beta', 2),
-             'expected': "1.1 beta 2"},
+             'expected': "1.1b2"},
             {'version': (1, 2, 1, 'rc', 3),
-             'expected': "1.2.1 rc 3"},
+             'expected': "1.2.1c3"},
             {'version': (1, 3, 0, 'final', 0),
              'expected': "1.3"},
             {'version': (1, 4, 1, 'beta', 0),
-             'expected': "1.4.1 beta"},
+             'expected': "1.4.1b0"},
             ]
         
         for version_dict in versions:

File registration/tests/backends.py

 
 from django.conf import settings
 from django.contrib import admin
-from django.contrib.auth.models import User
+try:
+    from django.contrib.auth import get_user_model
+except ImportError: # django < 1.5
+    from django.contrib.auth.models import User
+else:
+    User = get_user_model()
+
 from django.contrib.sessions.middleware import SessionMiddleware
 from django.contrib.sites.models import Site
 from django.core import mail

File registration/tests/forms.py

-from django.contrib.auth.models import User
+try:
+    from django.contrib.auth import get_user_model
+except ImportError: # django < 1.5
+    from django.contrib.auth.models import User
+else:
+    User = get_user_model()
+
 from django.test import TestCase
 
 from registration import forms

File registration/tests/models.py

 import re
 
 from django.conf import settings
-from django.contrib.auth.models import User
+try:
+    from django.contrib.auth import get_user_model
+except ImportError: # django < 1.5
+    from django.contrib.auth.models import User
+else:
+    User = get_user_model()
+
 from django.contrib.sites.models import Site
 from django.core import mail
 from django.core import management

File 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')),
                        )

File registration/tests/views.py

 import datetime
 
 from django.conf import settings
-from django.contrib.auth.models import User
+try:
+    from django.contrib.auth import get_user_model
+except ImportError: # django < 1.5
+    from django.contrib.auth.models import User
+else:
+    User = get_user_model()
+
 from django.core import mail
 from django.core.urlresolvers import reverse
 from django.test import TestCase
 
         """
         success_redirect = 'http://testserver%s' % reverse('registration_activation_complete')
+        print success_redirect
         
         # First, register an account.
         self.client.post(reverse('registration_register'),

File requirements.txt

+yolk
+# Django==1.4.3
+https://www.djangoproject.com/download/1.5c1/tarball/