def test_form_valid_message_not_str(self): mixin = FormValidMessageMixin() mixin.form_valid_message = ['bad'] with self.assertRaises(ImproperlyConfigured): mixin.get_form_valid_message()
def test_form_valid_returns_message(self): mixin = FormValidMessageMixin() mixin.form_valid_message = u'Good øø' self.assertEqual(u'Good øø', mixin.get_form_valid_message())
def test_form_valid_message_not_str(self): mixin = FormValidMessageMixin() mixin.form_valid_message = ["bad"] with self.assertRaises(ImproperlyConfigured): mixin.get_form_valid_message()
def test_form_valid_returns_message(self): mixin = FormValidMessageMixin() mixin.form_valid_message = u"Good øø" self.assertEqual(u"Good øø", mixin.get_form_valid_message())
def test_form_valid_returns_message(self): """get_form_valid_message should return the form_valid message""" mixin = FormValidMessageMixin() mixin.form_valid_message = "Good øø" self.assertEqual(force_str("Good øø"), mixin.get_form_valid_message())
def test_form_valid_message_not_str(self): """Non-strings for the form_valid message should raise ImproperlyConfigured""" mixin = FormValidMessageMixin() mixin.form_valid_message = ["bad"] with self.assertRaises(ImproperlyConfigured): mixin.get_form_valid_message()
def test_form_valid_message_not_set(self): """Not setting a form_valid message should raise ImproperlyConfigured""" mixin = FormValidMessageMixin() with self.assertRaises(ImproperlyConfigured): mixin.get_form_valid_message()
def test_form_valid_returns_message(self): mixin = FormValidMessageMixin() mixin.form_valid_message = 'Good øø' self.assertEqual(force_string('Good øø'), mixin.get_form_valid_message())
def form_valid(self, form): if self.get_registration_profile().identity_confirmed: raise Http404 response = FormValidMessageMixin.form_valid(self, form) self.get_registration_profile().send_admin_notification() return response