-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(NewTab): Boost syndicated article to position 1
- Loading branch information
Showing
8 changed files
with
173 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import pytest | ||
|
||
from app.models.corpus_item_model import CorpusItemModel | ||
from tests.assets.topics import business_topic | ||
|
||
|
||
@pytest.mark.parametrize(('url', 'is_syndicated'), [ | ||
('https://getpocket.com/explore/item/8-natural-ways-to-repel-insects-without-bug-spray', True), | ||
('http://getpocket.com/explore/item/8-natural-ways-to-repel-insects-without-bug-spray', True), | ||
('https://www.getpocket.com/explore/item/8-natural-ways-to-repel-insects-without-bug-spray', True), | ||
('https://pocket.com/explore/item/8-natural-ways-to-repel-insects-without-bug-spray', True), # pocket.com redirect | ||
('https://getpocket.com/explore/item/the-secrets-of-real-life-wedding-crashers?utm_source=pocket-newtab', True), | ||
('https://getpocket.com/collections/the-unexpected-flavor-combos-too-delicious-not-to-try', False), # collection | ||
('https://getpocket.com/explore/entertainment', False), # topic page | ||
('https://www.harpersbazaar.com/beauty/hair/a44284121/hair-braiders-harlem-injuries-protections/', False), | ||
('https://example.com/?utm_content=https://www.getpocket.com/explore/item/example', False), | ||
(None, None), | ||
]) | ||
def test_corpus_item_model_is_syndicated(url, is_syndicated): | ||
corpus_item = CorpusItemModel( | ||
id='rec-123', | ||
topic=business_topic.corpus_topic_id, | ||
publisher='The Original Publisher', | ||
url=url, | ||
) | ||
|
||
assert corpus_item.is_syndicated == is_syndicated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters