mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
chore(tests): use name from data when defined in DataLayerFactory
This commit is contained in:
parent
ebae9a8cd0
commit
0c52c35ae3
1 changed files with 3 additions and 1 deletions
|
@ -127,6 +127,9 @@ class DataLayerFactory(factory.django.DjangoModelFactory):
|
|||
def _adjust_kwargs(cls, **kwargs):
|
||||
if "data" in kwargs:
|
||||
data = copy.deepcopy(kwargs.pop("data"))
|
||||
data.setdefault("_umap_options", {})
|
||||
if "name" in data["_umap_options"] and kwargs["name"] == cls.name:
|
||||
kwargs["name"] = data["_umap_options"]["name"]
|
||||
if "settings" not in kwargs:
|
||||
kwargs["settings"] = data.get("_umap_options", {})
|
||||
else:
|
||||
|
@ -135,7 +138,6 @@ class DataLayerFactory(factory.django.DjangoModelFactory):
|
|||
**DataLayerFactory.settings._defaults,
|
||||
**kwargs["settings"],
|
||||
}
|
||||
data.setdefault("_umap_options", {})
|
||||
kwargs["settings"]["name"] = kwargs["name"]
|
||||
data["_umap_options"]["name"] = kwargs["name"]
|
||||
data.setdefault("type", "FeatureCollection")
|
||||
|
|
Loading…
Reference in a new issue