def get_random_fields(cls, obj_cls=None): obj_cls = obj_cls or cls._test_class fields = {} ip_version = tools.get_random_ip_version() for field, field_obj in obj_cls.fields.items(): if field not in obj_cls.synthetic_fields: generator = FIELD_TYPE_VALUE_GENERATOR_MAP[type(field_obj)] fields[field] = get_value(generator, ip_version) return obj_cls.modify_fields_to_db(fields)
def get_random_fields(cls, obj_cls=None): obj_cls = obj_cls or cls._test_class fields = {} ip_version = tools.get_random_ip_version() for field, field_obj in obj_cls.fields.items(): if field not in obj_cls.synthetic_fields: generator = FIELD_TYPE_VALUE_GENERATOR_MAP[type(field_obj)] fields[field] = get_value(generator, ip_version) return obj_cls.modify_fields_to_db(fields)