An ebook/comic library service and web client
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
544 B

  1. from atheneum.model import UserToken
  2. from atheneum.service.transformation_service import (
  3. serialize_model,
  4. deserialize_model
  5. )
  6. def test_serialize_model():
  7. user_token = UserToken()
  8. user_token.token = 'test'
  9. result = serialize_model(user_token)
  10. assert result is not None
  11. assert result['token'] == 'test'
  12. def test_deserialize_model():
  13. user_token_json = {
  14. 'token': 'test'
  15. }
  16. result = deserialize_model('UserToken', user_token_json)
  17. assert result is not None
  18. assert result.token == 'test'