-
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.
For #26 create custom Exceptions for send news job; add tests;change …
…user factory (to be inherit by others)
- Loading branch information
Showing
22 changed files
with
139 additions
and
96 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
Empty file.
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
class NewsFansNotFoundException(Exception): | ||
""" | ||
get triggered manager Profile model | ||
can't find users who wants to get newsletter | ||
""" | ||
|
||
pass | ||
|
||
|
||
class LetterNotFoundException(Exception): | ||
""" | ||
get triggered when there is no newsletter to send | ||
by cron jobs | ||
""" | ||
|
||
pass | ||
|
||
|
||
class JobError(Exception): | ||
""" | ||
get triggered if sending newsletter by cron failed | ||
""" | ||
|
||
pass |
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,36 @@ | ||
from django.contrib.auth import get_user_model | ||
from django.test import override_settings | ||
from django.urls import reverse | ||
from django_webtest import WebTest | ||
|
||
from src.accounts.tests.factories import UserFactory | ||
|
||
User = get_user_model() | ||
|
||
|
||
@override_settings(LANGUAGE_CODE="en", LANGUAGES=(("en", "English"),)) | ||
class SubscribeLinkTest(WebTest): | ||
def setUp(self): | ||
super().setUp() | ||
self.user = UserFactory() | ||
self.url = reverse("home") | ||
|
||
def test_auth_user_has_subscr_link_in_menu(self): | ||
"""Auth user has link to subscribe for a newsletter""" | ||
self.app.set_user(self.user) | ||
self.response = self.app.get(self.url) | ||
self.assertEqual(self.response.status_code, 200) | ||
|
||
subs_link = self.response.html.find("a", id="subLink") | ||
|
||
self.assertIsNotNone(subs_link) | ||
|
||
def test_unauth_user_no_link_in_menu(self): | ||
"""Unauth used - no link in menu to subscribe for a newsletter""" | ||
|
||
self.response = self.app.get(self.url) | ||
self.assertEqual(self.response.status_code, 200) | ||
|
||
subs_link = self.response.html.find("a", id="subLink") | ||
|
||
self.assertIsNone(subs_link) |
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
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,26 @@ | ||
|
||
{ | ||
"name":"Med Sandox", | ||
"short_name":"sanbox", | ||
"icons":[ | ||
{"src":"./android-chrome-192x192.png", | ||
"sizes":"192x192", | ||
"type":"image/png", | ||
"purporse":"maskable" | ||
}, | ||
{"src":"./android-chrome-512x512.png", | ||
"sizes":"512x512", | ||
"type":"image/png", | ||
"purporse":"maskable" | ||
}, | ||
{"src":"./apple-touch-icon.png", | ||
"sizes":"512x512", | ||
"type":"image/png", | ||
"purporse":"maskable" | ||
} | ||
|
||
], | ||
"display":"standalone", | ||
"description":"Medical education", | ||
"theme_color":"#f1dfc5" | ||
} |
Oops, something went wrong.