コード例 #1
0
    def test_entry_create_author_string_unicode(self):
        entry = EntryFactory()
        author = AuthorFactory()
        entry.authors.append(author)

        authorstring = entry.create_author_string()

        self.assertEqual(authorstring, author.name)

        author2 = AuthorFactory(name=u"Tĕstá ĀũʈĥőŘ")
        entry.authors.append(author2)

        authorstring = entry.create_author_string()

        self.assertEqual(authorstring, u'{0}, {1}'.format(author.name,
                                                          author2.name))
コード例 #2
0
    def test_entry_create_author_string(self):
        entry = EntryFactory()
        author = AuthorFactory()
        entry.authors.append(author)

        authorstring = entry.create_author_string()

        self.assertEqual(authorstring, author.name)

        author2 = AuthorFactory()
        entry.authors.append(author2)

        authorstring = entry.create_author_string()

        self.assertEqual(authorstring, '{0}, {1}'.format(author.name,
                                                         author2.name))