Exemplo n.º 1
0
 def test_questionary_not_exist_validator(self):
     with test_context(self.app):
         validator = QuestionaryExistValidator()
         try:
             res = validator._validate_python("5757ce79c42d752bde919318")
         except ValidationError:
             assert True
         else:
             assert False
Exemplo n.º 2
0
 def test_questionary_invalid_id_validator(self):
     with test_context(self.app):
         validator = QuestionaryExistValidator()
         try:
             res = validator._validate_python("Invalid")
         except ValidationError:
             assert True
         else:
             assert False
Exemplo n.º 3
0
 def test_questionary_exist_validator(self):
     self._login_lawyer()
     fake_questionary = self._create_fake_questionary('Test_validator')
     validator = QuestionaryExistValidator()
     try:
         res = validator._validate_python(str(fake_questionary._id))
     except ValidationError:
         assert False
     else:
         assert True