File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 4
4
.Python
5
5
tests /
6
6
.envrc
7
- __pycache__
7
+ __pycache__
8
+ htmlcov /
9
+ .coverage
10
+
Original file line number Diff line number Diff line change
1
+ import sys
2
+ import os
3
+ sys .path .append (os .path .dirname (os .path .dirname (os .path .abspath (__file__ ))))
4
+ import pytest
5
+ from server import app
6
+
7
+ @pytest .fixture
8
+ def client ():
9
+ app .config ['TESTING' ] = True
10
+ with app .test_client () as client :
11
+ yield client
12
+
13
+ def test_login_with_valid_email (client ):
14
+ response = client .post ('/showSummary' ,
15
+ data = {'email' : 'simplylift@club.com' },
16
+ follow_redirects = True )
17
+ assert response .status_code == 200
18
+ assert b'Welcome' in response .data
19
+
20
+ def test_login_with_invalid_email (client ):
21
+ response = client .post ('/showSummary' ,
22
+ data = {'email' : 'wrong@email.com' },
23
+ follow_redirects = True )
24
+ assert response .status_code == 200
25
+ assert b"Sorry, that email wasn't found." in response .data
You can’t perform that action at this time.
0 commit comments