예제 #1
0
 def test_mail_format(self):
     contact = Contact(email='*****@*****.**')
     self.assertEquals(contact.mail_format(), '*****@*****.**')
     contact = Contact(email='*****@*****.**', full_name='Toto')
     self.assertEquals(contact.mail_format(), 'Toto <*****@*****.**>')
     contact = Contact(email='*****@*****.**', full_name='Toto Titi')
     self.assertEquals(contact.mail_format(), 'Titi Toto <*****@*****.**>')
예제 #2
0
 def test_mail_format(self):
     contact = Contact(email='*****@*****.**')
     self.assertEquals(contact.mail_format(), '*****@*****.**')
     contact = Contact(email='*****@*****.**', full_name='Toto')
     self.assertEquals(contact.mail_format(), 'Toto <*****@*****.**>')
     contact = Contact(email='*****@*****.**', full_name='Toto Titi')
     self.assertEquals(contact.mail_format(), 'Titi Toto <*****@*****.**>')
예제 #3
0
 def test_vcard_format(self):
     contact = Contact(email='*****@*****.**', full_name='Toto Titi')
     self.assertEquals(contact.vcard_format(), 'BEGIN:VCARD\r\nVERSION:3.0\r\n' \
                                               'EMAIL;TYPE=INTERNET:[email protected]\r\nFN:Toto Titi\r\n' \
                                               'N:Titi Toto;;;\r\nEND:VCARD\r\n')
예제 #4
0
 def test_vcard_format(self):
     contact = Contact(email='*****@*****.**', full_name='Toto Titi')
     self.assertEquals(contact.vcard_format(), 'BEGIN:VCARD\r\nVERSION:3.0\r\n' \
                                               'EMAIL;TYPE=INTERNET:[email protected]\r\nFN:Toto Titi\r\n' \
                                               'N:Titi Toto;;;\r\nEND:VCARD\r\n')
예제 #5
0
 def test_unique(self):
     Contact(email='*****@*****.**').save()
     self.assertRaises(IntegrityError,
                       Contact(email='*****@*****.**').save)