Use correct tweet url
This commit is contained in:
parent
c41f35917e
commit
717191617b
3 changed files with 7 additions and 7 deletions
|
|
@ -65,7 +65,7 @@ class TwitterBuilderTestCase(TestCase):
|
|||
|
||||
self.assertEquals(post.author, "RobertsSpaceInd")
|
||||
self.assertEquals(
|
||||
post.url, f"{TWITTER_URL}/RobertsSpaceInd/1291528756373286914"
|
||||
post.url, f"{TWITTER_URL}/RobertsSpaceInd/status/1291528756373286914"
|
||||
)
|
||||
self.assertEquals(
|
||||
post.publication_date, pytz.utc.localize(datetime(2020, 8, 7, 0, 17, 5))
|
||||
|
|
@ -81,7 +81,7 @@ class TwitterBuilderTestCase(TestCase):
|
|||
|
||||
self.assertEquals(post.author, "RobertsSpaceInd")
|
||||
self.assertEquals(
|
||||
post.url, f"{TWITTER_URL}/RobertsSpaceInd/1288550304095416320"
|
||||
post.url, f"{TWITTER_URL}/RobertsSpaceInd/status/1288550304095416320"
|
||||
)
|
||||
self.assertEquals(
|
||||
post.publication_date, pytz.utc.localize(datetime(2020, 7, 29, 19, 1, 47))
|
||||
|
|
@ -110,7 +110,7 @@ class TwitterBuilderTestCase(TestCase):
|
|||
|
||||
self.assertEquals(post.author, "RobertsSpaceInd")
|
||||
self.assertEquals(
|
||||
post.url, f"{TWITTER_URL}/RobertsSpaceInd/1269039237166321664"
|
||||
post.url, f"{TWITTER_URL}/RobertsSpaceInd/status/1269039237166321664"
|
||||
)
|
||||
self.assertEquals(
|
||||
post.publication_date, pytz.utc.localize(datetime(2020, 6, 5, 22, 51, 46))
|
||||
|
|
@ -175,7 +175,7 @@ class TwitterBuilderTestCase(TestCase):
|
|||
|
||||
self.assertEquals(post.author, "RobertsSpaceInd")
|
||||
self.assertEquals(
|
||||
post.url, f"{TWITTER_URL}/RobertsSpaceInd/1291080532361527296"
|
||||
post.url, f"{TWITTER_URL}/RobertsSpaceInd/status/1291080532361527296"
|
||||
)
|
||||
self.assertEquals(
|
||||
post.publication_date, pytz.utc.localize(datetime(2020, 8, 5, 18, 36, 0))
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class TwitterCollectorTestCase(TestCase):
|
|||
self.assertEquals(post.author, "RobertsSpaceInd")
|
||||
self.assertEquals(post.title, title)
|
||||
self.assertEquals(
|
||||
post.url, f"{TWITTER_URL}/RobertsSpaceInd/1307054882210435074"
|
||||
post.url, f"{TWITTER_URL}/RobertsSpaceInd/status/1307054882210435074"
|
||||
)
|
||||
|
||||
post = Post.objects.get(
|
||||
|
|
@ -106,7 +106,7 @@ class TwitterCollectorTestCase(TestCase):
|
|||
self.assertEquals(post.author, "RobertsSpaceInd")
|
||||
self.assertEquals(post.title, title)
|
||||
self.assertEquals(
|
||||
post.url, f"{TWITTER_URL}/RobertsSpaceInd/1307029168941461504"
|
||||
post.url, f"{TWITTER_URL}/RobertsSpaceInd/status/1307029168941461504"
|
||||
)
|
||||
|
||||
def test_empty_batch(self):
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class TwitterBuilder(PostBuilder):
|
|||
if remote_identifier in self.existing_posts:
|
||||
continue
|
||||
|
||||
url = f"{TWITTER_URL}/{rule.screen_name}/{remote_identifier}"
|
||||
url = f"{TWITTER_URL}/{rule.screen_name}/status/{remote_identifier}"
|
||||
body = urlize(post["full_text"], nofollow=True)
|
||||
title = truncate_text(
|
||||
Post, "title", self.sanitize_fragment(post["full_text"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue