Merge branch 'issue-59-no-author-name'
This commit is contained in:
commit
5a01d0aa47
2 changed files with 10 additions and 3 deletions
|
@ -333,11 +333,14 @@ class FeedEntry(object):
|
||||||
self.__atom_author = []
|
self.__atom_author = []
|
||||||
self.__atom_author += ensure_format(author,
|
self.__atom_author += ensure_format(author,
|
||||||
set(['name', 'email', 'uri']),
|
set(['name', 'email', 'uri']),
|
||||||
set(['name']))
|
set())
|
||||||
self.__rss_author = []
|
self.__rss_author = []
|
||||||
for a in self.__atom_author:
|
for a in self.__atom_author:
|
||||||
if a.get('email'):
|
if a.get('email'):
|
||||||
self.__rss_author.append('%(email)s (%(name)s)' % a)
|
if a.get('name'):
|
||||||
|
self.__rss_author.append('%(email)s (%(name)s)' % a)
|
||||||
|
else:
|
||||||
|
self.__rss_author.append('%(email)s' % a)
|
||||||
return self.__atom_author
|
return self.__atom_author
|
||||||
|
|
||||||
def content(self, content=None, src=None, type=None):
|
def content(self, content=None, src=None, type=None):
|
||||||
|
|
|
@ -63,7 +63,11 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||||
fe = self.fg.add_item()
|
fe = self.fg.add_item()
|
||||||
fe.title('qwe')
|
fe.title('qwe')
|
||||||
assert fe.title() == 'qwe'
|
assert fe.title() == 'qwe'
|
||||||
author = fe.author(name='John Doe', email='jdoe@example.com')[0]
|
author = fe.author(email='ldoe@example.com')[0]
|
||||||
|
assert not author.get('name')
|
||||||
|
assert author.get('email') == 'ldoe@example.com'
|
||||||
|
author = fe.author(name='John Doe', email='jdoe@example.com',
|
||||||
|
replace=True)[0]
|
||||||
assert author.get('name') == 'John Doe'
|
assert author.get('name') == 'John Doe'
|
||||||
assert author.get('email') == 'jdoe@example.com'
|
assert author.get('email') == 'jdoe@example.com'
|
||||||
contributor = fe.contributor(name='John Doe', email='jdoe@ex.com')[0]
|
contributor = fe.contributor(name='John Doe', email='jdoe@ex.com')[0]
|
||||||
|
|
Loading…
Reference in a new issue