', preview.description)
@@ -2381,7 +2385,7 @@ def test_create_comment_on_post_urls(self):
def test_create_comment_with_photo(self):
self.expect_urlopen(
'547822715231468/comments', {'id': '456_789'},
- data=urllib.urlencode({'message': 'cc Sam G, Michael M',
+ data=urllib.parse.urlencode({'message': 'cc Sam G, Michael M',
'attachment_url': 'http://pict/ure'}))
self.mox.ReplayAll()
@@ -2397,7 +2401,7 @@ def test_create_comment_with_photo(self):
}, self.fb.create(obj).content)
preview = self.fb.preview_create(obj)
- self.assertEquals('cc Sam G, Michael M
', preview.description)
@@ -2496,7 +2500,7 @@ def test_create_rsvp(self):
'%s\n%s' % (created.content, rsvp))
preview = self.fb.preview_create(rsvp)
- self.assertEquals('
RSVP maybe to '
+ self.assertEqual('
RSVP maybe to '
'
this event.',
preview.description)
@@ -2604,19 +2608,20 @@ def test_create_with_photo(self):
# test preview
preview = self.fb.preview_create(obj)
- self.assertEquals('
post:', preview.description)
- self.assertEquals(u'my caption
',
+ self.assertEqual('
post:', preview.description)
+ self.assertEqual('my caption
',
preview.content)
# test create
self.expect_urlopen(API_ALBUMS % 'me', {'data': []})
self.expect_urlopen(API_PUBLISH_PHOTO, {'id': '123_456'},
- data=u'url=http%3A%2F%2Fmy%2Fpictur%C3%A9&message=my+caption')
+ data='message=my+caption&url=http%3A%2F%2Fmy%2Fpictur%C3%A9')
self.mox.ReplayAll()
self.assert_equals({
'id': '123_456',
'url': 'https://www.facebook.com/123/posts/456',
- 'type': 'post'}, self.fb.create(obj).content)
+ 'type': 'post',
+ }, self.fb.create(obj).content)
def test_create_with_photo_uses_timeline_photos_album(self):
"""https://github.com/snarfed/bridgy/issues/571"""
@@ -2629,8 +2634,10 @@ def test_create_with_photo_uses_timeline_photos_album(self):
{'id': '1', 'name': 'foo bar'},
{'id': '2', 'type': 'wall'},
]})
- self.expect_urlopen('2/photos', {}, data=urllib.urlencode({
- 'url': 'http://my/picture', 'message': ''}))
+ self.expect_urlopen('2/photos', {}, data=urllib.parse.urlencode((
+ ('message', ''),
+ ('url', 'http://my/picture'),
+ )))
self.mox.ReplayAll()
self.assert_equals({'type': 'post', 'url': None}, self.fb.create(obj).content)
@@ -2650,7 +2657,7 @@ def test_create_with_photo_and_person_tags(self):
# test preview
preview = self.fb.preview_create(obj)
- self.assertEquals(
+ self.assertEqual(
'
with '
'Foo, '
'User 345',
@@ -2659,11 +2666,11 @@ def test_create_with_photo_and_person_tags(self):
# test create
self.expect_urlopen(API_ALBUMS % 'me', {'data': []})
self.expect_urlopen(
- API_PUBLISH_PHOTO, {'id': '123_456'}, data=urllib.urlencode({
- 'url': 'http://my/picture',
- 'message': '',
- 'tags': json.dumps([{'tag_uid': '234'}, {'tag_uid': '345'}]),
- }))
+ API_PUBLISH_PHOTO, {'id': '123_456'}, data=urllib.parse.urlencode((
+ ('message', ''),
+ ('url', 'http://my/picture'),
+ ('tags', json.dumps([{'tag_uid': '234'}, {'tag_uid': '345'}])),
+ )))
self.mox.ReplayAll()
self.assert_equals({
'id': '123_456',
@@ -2681,13 +2688,13 @@ def test_create_with_video(self):
# test preview
preview = self.fb.preview_create(obj)
- self.assertEquals('
post:', preview.description)
- self.assertEquals('my\ncaption