-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestUserModel.py
41 lines (30 loc) · 1.03 KB
/
testUserModel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from unittest import TestCase, main
from models.users import UserModel
from createApp import create_app
app = create_app()
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///database.db'
app.app_context().push()
class TesteUserModel(TestCase):
data = {
"login": "[email protected]",
"password": "12345",
"city": "Curitiba"
}
new_login = "[email protected]"
new_password = "teste"
new_city = "São paulo"
user_model = UserModel(**data)
def test_save_user(self):
self.user_model.save_user()
def test_json(self):
assert self.user_model.json()
def test_update_user_login(self):
self.user_model.update_user_login( self.new_login )
def test_update_user_password(self):
self.user_model.update_user_password( self.new_password )
def test_update_user_city(self):
self.user_model.update_user_city( self.new_city )
def test_find_user(self):
assert self.user_model.find_user(1)
if __name__ == '__main__':
main()