Commits

James Bennett committed 7c65d9d

Test the ability to open and close registration using a setting.

  • Participants
  • Parent commits 5b4c306

Comments (0)

Files changed (1)

registration/tests.py

         expired_profile = RegistrationProfile.objects.get(user=expired_user)
         self.failIf(self.backend.activate({}, expired_profile.activation_key))
         self.failUnless(expired_profile.activation_key_expired())
+
+    def test_allow(self):
+        """
+        Test that the setting ``REGISTRATION_OPEN`` appropriately
+        controls whether registration is permitted.
+        
+        """
+        self.failUnless(self.backend.registration_allowed({}))
+        settings.REGISTRATION_OPEN = False
+        self.failIf(self.backend.registration_allowed({}))