-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added tests for the logic of mii_rss
- Loading branch information
Alexis Durand
committed
Jan 11, 2016
1 parent
93646e7
commit a071303
Showing
4 changed files
with
47 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from datetime import timedelta | ||
|
||
from django.utils import timezone | ||
from factory import DjangoModelFactory | ||
from factory.fuzzy import FuzzyInteger, FuzzyChoice, FuzzyDateTime | ||
|
||
from mii_rss.models import FeedDownloaded, FeedEntries | ||
|
||
|
||
class FeedDownloadedFactory(DjangoModelFactory): | ||
class Meta: | ||
model = FeedDownloaded | ||
django_get_or_create = ('re_filter', 'season', 'episode',) | ||
|
||
season = FuzzyInteger(0, 20) | ||
episode = FuzzyInteger(0, 20) | ||
re_filter = FuzzyChoice(['Serie1', 'Serie2', 'Serie3']) | ||
|
||
|
||
class FeedEntriesFactory(DjangoModelFactory): | ||
class Meta: | ||
model = FeedEntries | ||
json_entries = '{"entries": [{"link": "/file.torrent?", "title": "file"}]}' | ||
date = FuzzyDateTime(timezone.now() - timedelta(days=2)) |
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