-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dev' into bugfix/waitlist_email
- Loading branch information
Showing
3 changed files
with
68 additions
and
32 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,45 @@ | ||
{% extends 'base.html' %} {% block title %}Welcome{% endblock %} {% block | ||
content %} | ||
<table role="presentation" width="100%" style="padding: 3.5rem"> | ||
<tr> | ||
<td> | ||
<div style="text-align: center; margin-bottom: 1.5rem"> | ||
<h1 style="font-size: 1.5rem; color: #0a0a0a; font-weight: 600"> | ||
Hello From The Boilerplate | ||
</h1> | ||
<p | ||
style=" | ||
font-size: 1.125rem; | ||
color: rgba(0, 0, 0, 0.8); | ||
font-weight: 500; | ||
" | ||
> | ||
Unsubscription Successful | ||
</p> | ||
</div> | ||
|
||
<div> | ||
<p style="color: #111; font-size: 1.125rem; font-weight: 600"> | ||
Hi Hope this find you well. | ||
</p> | ||
<p style="color: rgba(17, 17, 17, 0.9); font-weight: 400"> | ||
You have successfully Unsubscribed from our email newsletter. | ||
</p> | ||
<p style="color: rgba(17, 17, 17, 0.9); font-weight: 400"> | ||
This emai is a confirmation of that action. As you will not recieve | ||
any newsletter updates from us anymore. | ||
</p> | ||
</div> | ||
|
||
<!-- <div style="margin-top: 2rem;"> | ||
<p style="color: #111; font-size: 0.875rem; font-weight: 500;">Thank you for joining Boilerplate</p> | ||
</div> --> | ||
|
||
<div style="margin-top: 2rem"> | ||
<p>Regards,</p> | ||
<p>Boilerplate</p> | ||
</div> | ||
</td> | ||
</tr> | ||
</table> | ||
{% endblock %} |
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 |
---|---|---|
|
@@ -12,12 +12,12 @@ | |
from main import app | ||
|
||
|
||
|
||
@pytest.fixture | ||
def db_session_mock(): | ||
db_session = MagicMock(spec=Session) | ||
return db_session | ||
|
||
|
||
@pytest.fixture | ||
def client(db_session_mock): | ||
app.dependency_overrides[get_db] = lambda: db_session_mock | ||
|
@@ -26,24 +26,6 @@ def client(db_session_mock): | |
app.dependency_overrides = {} | ||
|
||
|
||
@patch("api.v1.services.newsletter.NewsletterService.unsubscribe") | ||
def test_newsletter_subscribe(mock_unsubscribe, db_session_mock, client): | ||
"""Tests the POST /api/v1/newsletter-subscription endpoint to ensure successful subscription with valid input.""" | ||
|
||
mock_unsubscribe.return_value = None | ||
|
||
db_session_mock.add.return_value = None | ||
db_session_mock.commit.return_value = None | ||
db_session_mock.refresh.return_value = None | ||
|
||
response = client.post('/api/v1/newsletters/unsubscribe', json={ | ||
"email": "[email protected]" | ||
}) | ||
|
||
print('response', response.json()) | ||
assert response.status_code == 200 | ||
|
||
|
||
@patch("api.v1.services.newsletter.NewsletterService.unsubscribe") | ||
def test_newsletter_subscribe_missing_fields(mock_unsubscribe, db_session_mock, client): | ||
"""Tests the POST /api/v1/newsletter-subscription endpoint for missing required fields.""" | ||
|
@@ -54,7 +36,5 @@ def test_newsletter_subscribe_missing_fields(mock_unsubscribe, db_session_mock, | |
db_session_mock.commit.return_value = None | ||
db_session_mock.refresh.return_value = None | ||
|
||
response = client.post('/api/v1/newsletter-subscription', json={ | ||
|
||
}) | ||
response = client.post("/api/v1/newsletter-subscription", json={}) | ||
assert response.status_code == 422 |