コード例 #1
0
ファイル: tests.py プロジェクト: goldstuff/django_form_fields
class ProEmailFieldTestCase(unittest.TestCase, FormFieldTestCase):
        
    def setUp(self):
        #pass along a list of excluded domains upon instantiation
        self.formfield = ProEmailField(['gmail', 'yahoo'])
                
    def test_clean_fails(self):
        self.assertRaises(ValidationError, self.formfield.clean,'*****@*****.**')
        
    def test_clean_passes(self):
        #if value validates, clean must return the value
        self.assertEqual(self.formfield.clean('*****@*****.**'), u'*****@*****.**')
コード例 #2
0
ファイル: tests.py プロジェクト: goldstuff/django_form_fields
 def setUp(self):
     #pass along a list of excluded domains upon instantiation
     self.formfield = ProEmailField(['gmail', 'yahoo'])