A multipurpose python flask API server and administration SPA
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.
|
|
from corvus.model import User from corvus.service import role_service, validation_service
def test_successful_validation(): request_user = User() request_user.role = role_service.Role.USER
user = User() user.role = role_service.Role.USER
validation_result = validation_service.validate_model(request_user, user) assert validation_result.success
def test_failed_validation(): request_user = User() request_user.role = role_service.Role.ANONYMOUS
user = User() user.role = role_service.Role.USER
validation_result = validation_service.validate_model(request_user, user) assert validation_result.success is False assert 'role' in validation_result.failed
|