示例#1
0
    def test_date_of_birth_high_range(self):

        validation = FormValidation()

        date_string = date.today() + timedelta(days=1)

        self.assertFalse(validation.date_of_birth(date_string.strftime('%d/%m/%Y')))
示例#2
0
    def test_name_invalid(self):

        validation = FormValidation()

        self.assertFalse(validation.name('James!!'))
示例#3
0
    def test_name_filled_four(self):

        validation = FormValidation()

        self.assertTrue(validation.name('James-Christopher 3'))
示例#4
0
    def test_name_filled_two(self):

        validation = FormValidation()

        self.assertTrue(validation.name('James Christopher'))
示例#5
0
    def test_email_invalid_three(self):

        validation = FormValidation()

        self.assertFalse(validation.email('jessica@out look.com'))
示例#6
0
    def test_email_filled_two(self):

        validation = FormValidation()

        self.assertTrue(validation.email('*****@*****.**'))
示例#7
0
    def test_email_fail(self):

        validation = FormValidation()

        self.assertFalse(validation.email(''))
示例#8
0
    def test_last_name_filled_four(self):

        validation = FormValidation()

        self.assertTrue(validation.name('Johnson 3rd'))
示例#9
0
    def test_date_of_birth_low_range(self):

        validation = FormValidation()

        self.assertFalse(validation.date_of_birth('31/12/1899'))
示例#10
0
    def test_date_of_birth_invalid_three(self):

        validation = FormValidation()

        self.assertFalse(validation.date_of_birth('24/5/1995'))
示例#11
0
    def test_date_of_birth_invalid_two(self):

        validation = FormValidation()

        self.assertFalse(validation.date_of_birth('24-5-1995'))
示例#12
0
    def test_date_of_birth_invalid(self):

        validation = FormValidation()

        self.assertFalse(validation.date_of_birth('1995/05/24'))
示例#13
0
    def test_date_of_birth(self):

        validation = FormValidation()

        self.assertTrue(validation.date_of_birth('24/05/1995'))
示例#14
0
    def test_name_empty(self):

        validation = FormValidation()

        self.assertFalse(validation.name(''))
示例#15
0
    def test_form_validation(self):

        validation = FormValidation()

        self.assertIsInstance(validation, FormValidation)
示例#16
0
    def test_last_name_filled_three(self):

        validation = FormValidation()

        self.assertTrue(validation.name('Jo-Johnson'))
示例#17
0
    def test_terms_conditions(self):

        validation = FormValidation()

        self.assertTrue(validation.terms_conditions('on'))
示例#18
0
    def test_last_name_invalid(self):

        validation = FormValidation()

        self.assertFalse(validation.name('Johnson$'))
示例#19
0
    def test_terms_conditions_invalid(self):

        validation = FormValidation()

        self.assertFalse(validation.terms_conditions(''))
示例#20
0
    def test_email_filled(self):

        validation = FormValidation()

        self.assertTrue(validation.email('*****@*****.**'))
示例#21
0
    def test_name_filled(self):

        validation = FormValidation()

        self.assertTrue(validation.name('James'))
示例#22
0
    def test_email_filled_three(self):

        validation = FormValidation()

        self.assertTrue(validation.email('*****@*****.**'))
示例#23
0
    def test_email_invalid(self):

        validation = FormValidation()

        self.assertFalse(validation.email('jessica.smith.outlook.com'))