コード例 #1
0
def test_project_schema_dump_one_dict_many_false(project_schema: ProjectSchema,
                                                 deserialized_project: Project,
                                                 serialized_project: dict):
    assert project_schema.dump(deserialized_project) == serialized_project
コード例 #2
0
def test_project_schema_dump_list_no_empty_many_true(
        project_schema: ProjectSchema, deserialized_project: Project):
    assert len(project_schema.dump([deserialized_project], many=True)) == 1
コード例 #3
0
def test_project_schema_dump_list_of_dicts_many_true(
        project_schema: ProjectSchema, deserialized_project: Project):
    assert type(project_schema.dump([deserialized_project],
                                    many=True)[0]) is dict
コード例 #4
0
def test_project_schema_dump_one_dict_many_true(project_schema: ProjectSchema,
                                                deserialized_project: Project,
                                                serialized_project: dict):
    assert project_schema.dump([deserialized_project],
                               many=True) == [serialized_project]