Пример #1
0
 def test_raise_error_if_no_user_id(self) -> None:
     """
     Error is raised if deserialization of Dict will not generate a user_id
     :return:
     """
     with app.test_request_context():
         data, errors = UserSchema().load({'display_name': 'Test User'})
         self.assertEqual(len(errors['_schema']), 1)
 def test_raise_error_if_no_user_id(self) -> None:
     """
     Error is raised if deserialization of Dict will not generate a user_id
     :return:
     """
     with app.test_request_context():
         with self.assertRaises(ValidationError):
             UserSchema().load({'display_name': 'Test User'})
Пример #3
0
 def test_str_no_value(self) -> None:
     """
     Test _str_no_value returns True for a string of spaces
     :return:
     """
     self.assertEqual(UserSchema()._str_no_value(' '), True)