def test_username_domain_at_sign(self): self.assertTrue(b('*****@*****.**')) self.assertTrue(b('*****@*****.**')) self.assertFalse(b('test@')) self.assertFalse(b('[email protected]@fd')) self.assertFalse(b('[email protected]@@@@')) self.assertFalse(b('test')) self.assertFalse(b('[email protected]@.ra')) self.assertFalse(b('@yandex.ru'))
def test_domain_not_end_begin_dash(self): self.assertFalse(b('*****@*****.**')) self.assertFalse(b('*****@*****.**')) self.assertFalse(b('*****@*****.**')) self.assertFalse(b('*****@*****.**')) self.assertFalse(b('[email protected]')) self.assertFalse(b('[email protected]')) self.assertTrue(b('*****@*****.**'))
def test_domain_length_symbols_dots(self): self.assertFalse(b('test@' + 'ya.ru' * 256)) self.assertTrue(b('[email protected]')) self.assertFalse(b('*****@*****.**')) self.assertFalse(b('test@yandex.')) self.assertFalse(b('*****@*****.**')) self.assertTrue(b('[email protected]_.a.a.a.a.ru'))
def test_domain_length_symbols_dots(self): self.assertFalse(b('test@'+'ya.ru'*256)) self.assertTrue(b('[email protected]')) self.assertFalse(b('*****@*****.**')) self.assertFalse(b('test@yandex.')) self.assertFalse(b('*****@*****.**')) self.assertTrue(b('[email protected]_.a.a.a.a.ru'))
def test_username_symbols_between_marks(self): self.assertTrue(b('test"eh!,eh:"*****@*****.**')) self.assertFalse(b('de!,::"elng"@spok.ru')) self.assertFalse(b('de"testg!",:[email protected]'))
def test_username_paired_quotation_marks(self): self.assertTrue(b('teste""*****@*****.**')) self.assertFalse(b('de""test"*****@*****.**')) self.assertFalse(b('teste"*****@*****.**'))
def test_username_two_dots(self): self.assertTrue(b('*****@*****.**')) self.assertFalse(b('*****@*****.**'))
def test_username_length_symbols(self): self.assertTrue(b('d' * 128 + '@yandex.ru')) self.assertFalse(b('d' * 129 + '@yandex.ru')) self.assertTrue(b('test._-n""*****@*****.**'))
def test_username_length_symbols(self): self.assertTrue(b('d'*128+'@yandex.ru')) self.assertFalse(b('d'*129+'@yandex.ru')) self.assertTrue(b('test._-n""*****@*****.**'))