Esempio n. 1
0
 def setUp(self):
     mail = 'From: %s\n' % self.from_header + \
            'Subject: test\n\n' + \
            'test'
     self.email = message_from_string(mail)
     (self.person, new) = find_author(self.email)
     self.person.save()
Esempio n. 2
0
 def setUp(self):
     mail = 'Message-Id: %s\n' % make_msgid() + \
            'From: %s\n' % self.from_header + \
            'Subject: test\n\n' + \
            'test'
     self.email = message_from_string(mail)
     (self.person, new) = find_author(self.email)
     self.person.save()
Esempio n. 3
0
 def setUp(self):
     mail = 'Message-Id: %s\n' % make_msgid() + \
            'From: %s\n' % self.from_header + \
            'Subject: test\n\n' + \
            'test'
     self.email = message_from_string(mail)
     self.person = find_author(self.email)
     self.person.save()
Esempio n. 4
0
 def testNonExisingSender(self):
     (person, new) = find_author(self.non_existing_sender_mail)
     self.assertEqual(new, True)
     self.assertEqual(person.id, None)
Esempio n. 5
0
 def testExisingSender(self):
     (person, new) = find_author(self.existing_sender_mail)
     self.assertEqual(new, False)
     self.assertEqual(person.id, self.person.id)
Esempio n. 6
0
 def setUp(self):
     self.existing_sender_mail = self.mail(self.existing_sender)
     self.non_existing_sender_mail = self.mail(self.non_existing_sender)
     (self.person, new) = find_author(self.existing_sender_mail)
     self.person.save()
Esempio n. 7
0
 def testExistingUpdateName(self):
     mail = self.mail(self.existing_sender_new_name)
     (person, save_required) = find_author(mail)
     self.assertEqual(save_required, True)
     self.assertEqual(person.id, self.person.id)
Esempio n. 8
0
 def testExistingDifferentEmailCase(self):
     mail = self.mail(self.existing_sender_upper)
     (person, save_required) = find_author(mail)
     self.assertEqual(save_required, False)
     self.assertEqual(person.id, self.person.id)
Esempio n. 9
0
 def test_existing_sender(self):
     person = find_author(self.existing_sender_mail)
     self.assertEqual(person._state.adding, False)
     self.assertEqual(person.id, self.person.id)
Esempio n. 10
0
 def testNonExisingSender(self):
     (person, save_required) = find_author(self.non_existing_sender_mail)
     self.assertEqual(save_required, True)
     self.assertEqual(person.id, None)
Esempio n. 11
0
 def testExisingSender(self):
     (person, save_required) = find_author(self.existing_sender_mail)
     self.assertEqual(save_required, False)
     self.assertEqual(person.id, self.person.id)
Esempio n. 12
0
 def setUp(self):
     mail = "From: %s\n" % self.from_header + "Subject: test\n\n" + "test"
     self.email = message_from_string(mail)
     (self.person, new) = find_author(self.email)
     self.person.save()
Esempio n. 13
0
 def test_existing_different_case(self):
     mail = self.mail(self.existing_sender.upper())
     person = find_author(mail)
     self.assertEqual(person._state.adding, False)
     self.assertEqual(person.id, self.person.id)
Esempio n. 14
0
 def test_existing_different_format(self):
     mail = self.mail('*****@*****.**')
     person = find_author(mail)
     self.assertEqual(person._state.adding, False)
     self.assertEqual(person.id, self.person.id)
Esempio n. 15
0
 def test_non_existing_sender(self):
     person = find_author(self.non_existing_sender_mail)
     self.assertEqual(person._state.adding, True)
     self.assertEqual(person.id, None)
Esempio n. 16
0
 def testExistingDifferentFormat(self):
     mail = self.mail('*****@*****.**')
     (person, new) = find_author(mail)
     self.assertEqual(new, False)
     self.assertEqual(person.id, self.person.id)
Esempio n. 17
0
 def testExistingDifferentCase(self):
     mail = self.mail(self.existing_sender.upper())
     (person, new) = find_author(mail)
     self.assertEqual(new, False)
     self.assertEqual(person.id, self.person.id)
Esempio n. 18
0
 def testExistingDifferentFormat(self):
     mail = self.mail(self.existing_sender_alternate_format)
     (person, save_required) = find_author(mail)
     self.assertEqual(save_required, False)
     self.assertEqual(person.id, self.person.id)