Exemple #1
0
 def test_author_names(self):
     names = [("Bob", "Marley", "Bob Marley"), ("Cher", "", "Cher "), ("Sting", "", "Sting "), ("Elliott", "Smith", "Elliott Smith")]
     author = User();
     p1 = Post(author=author)
     for first_name, last_name, expected in names:
         author.first_name = first_name
         author.last_name = last_name
         actual = p1.author_name()
         self.assertEqual(expected, actual)
Exemple #2
0
    def test_author_names(self):
        names = [("Bob", "Marley", "Bob Marley"),
                 ("Name", "Two", "Name Two"),
                 ("Sting", "", "Sting ")]

        author = User()
        p1 = Post(author=author)

        for first_name, last_name, expected in names:
            author.first_name = first_name
            author.last_name = last_name
            actual = p1.author_name()
            self.assertEqual(expected, actual)
Exemple #3
0
 def test_author_name(self):
     expected = u"Mr. Administrator"
     p1 = Post(author=self.user)
     actual = p1.author_name()
     self.assertEqual(expected, actual)