refactor and move tests

This commit is contained in:
collerek
2020-09-23 10:09:15 +02:00
parent ebd812bf00
commit 798475ae5f
9 changed files with 158 additions and 143 deletions

View File

@ -274,7 +274,9 @@ def choices_validator(cls: Type["Model"], values: Dict[str, Any]) -> Dict[str, A
return values
def populate_choices_validators(model: Type["Model"], attrs: Dict) -> None: # noqa CCR001
def populate_choices_validators( # noqa CCR001
model: Type["Model"], attrs: Dict
) -> None:
if model_initialized_and_has_model_fields(model):
for _, field in model.Meta.model_fields.items():
if check_if_field_has_choices(field):