コード例 #1
0
 def test_form_valid_message_not_str(self):
     mixin = FormValidMessageMixin()
     mixin.form_valid_message = ['bad']
     with self.assertRaises(ImproperlyConfigured):
         mixin.get_form_valid_message()
コード例 #2
0
 def test_form_valid_returns_message(self):
     mixin = FormValidMessageMixin()
     mixin.form_valid_message = u'Good øø'
     self.assertEqual(u'Good øø', mixin.get_form_valid_message())
コード例 #3
0
 def test_form_valid_message_not_str(self):
     mixin = FormValidMessageMixin()
     mixin.form_valid_message = ["bad"]
     with self.assertRaises(ImproperlyConfigured):
         mixin.get_form_valid_message()
コード例 #4
0
 def test_form_valid_returns_message(self):
     mixin = FormValidMessageMixin()
     mixin.form_valid_message = u"Good øø"
     self.assertEqual(u"Good øø", mixin.get_form_valid_message())
コード例 #5
0
 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())
コード例 #6
0
 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()
コード例 #7
0
 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()
コード例 #8
0
 def test_form_valid_returns_message(self):
     mixin = FormValidMessageMixin()
     mixin.form_valid_message = 'Good øø'
     self.assertEqual(force_string('Good øø'),
                      mixin.get_form_valid_message())
コード例 #9
0
ファイル: views.py プロジェクト: millanp/dappr_wrappr
 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