Commits

James Bennett  committed 5b4c306

Make the signature match UserManager.create_user.

  • Participants
  • Parent commits 091c136

Comments (0)

Files changed (3)

File registration/backends/default/__init__.py

     fields and supported operations.
     
     """
-    def register(self, request, username, password, email):
+    def register(self, request, username, email, password):
         """
         Given a username, email address and password, register a new
         user account, which will initially be inactive.
             site = Site.objects.get_current()
         else:
             site = RequestSite(request)
-        return RegistrationProfile.objects.create_inactive_user(username, password, email, site)
+        return RegistrationProfile.objects.create_inactive_user(username, email, password, site)
 
     def activate(self, request, activation_key):
         """

File registration/models.py

                 return user
         return False
     
-    def create_inactive_user(self, username, password, email, site):
+    def create_inactive_user(self, username, email, password, site):
         """
         Create a new, inactive ``User``, generate a
         ``RegistrationProfile`` and email its activation key to the

File registration/tests.py

         email.
         
         """
-        new_user = self.backend.register({}, 'bob', 'secret', 'bob@example.com')
+        new_user = self.backend.register({}, 'bob', 'bob@example.com', 'secret')
         self.assertEqual(new_user.username, 'bob')
         self.failUnless(new_user.check_password('secret'))
         self.assertEqual(new_user.email, 'bob@example.com')
         """
         # First, test with a user activating inside the activation
         # window.
-        valid_user = self.backend.register({}, 'alice', 'swordfish', 'alice@example.com')
+        valid_user = self.backend.register({}, 'alice', 'alice@example.com', 'swordfish')
         valid_profile = RegistrationProfile.objects.get(user=valid_user)
         activated = self.backend.activate({}, valid_profile.activation_key)
         self.assertEqual(activated.username, valid_user.username)
 
         # Now test again, but with a user activating outside the
         # activation window.
-        expired_user = self.backend.register({}, 'bob', 'secret', 'bob@example.com')
+        expired_user = self.backend.register({}, 'bob', 'bob@example.com', 'secret')
         expired_user.date_joined = expired_user.date_joined - datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS)
         expired_user.save()
         expired_profile = RegistrationProfile.objects.get(user=expired_user)