FitTrackee/fittrackee_api/fittrackee_api/tests/test_users_model.py

21 lines
880 B
Python
Raw Normal View History

2018-05-13 18:36:31 +02:00
def test_user_model(app, user_1):
assert '<User \'test\'>' == str(user_1)
2018-05-12 19:13:59 +02:00
2018-05-13 18:36:31 +02:00
serialized_user = user_1.serialize()
assert 'test' == serialized_user['username']
assert 'created_at' in serialized_user
assert serialized_user['admin'] is False
assert serialized_user['first_name'] is None
assert serialized_user['last_name'] is None
assert serialized_user['bio'] is None
assert serialized_user['location'] is None
assert serialized_user['birth_date'] is None
assert serialized_user['picture'] is False
assert serialized_user['timezone'] is None
assert serialized_user['weekm'] is False
assert serialized_user['language'] is None
assert serialized_user['nb_activities'] == 0
assert serialized_user['nb_sports'] == 0
assert serialized_user['total_distance'] == 0
assert serialized_user['total_duration'] == '0:00:00'