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
|
2018-06-11 15:10:18 +02:00
|
|
|
assert serialized_user['timezone'] is None
|
2019-08-31 16:33:46 +02:00
|
|
|
assert serialized_user['weekm'] is False
|
2019-09-16 14:19:21 +02:00
|
|
|
assert serialized_user['language'] is None
|
2018-06-05 18:16:53 +02:00
|
|
|
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'
|