diff --git a/umap/tests/conftest.py b/umap/tests/conftest.py index 0f3bd6ce..a9a29726 100644 --- a/umap/tests/conftest.py +++ b/umap/tests/conftest.py @@ -5,8 +5,13 @@ import pytest from django.core.cache import cache from django.core.signing import get_cookie_signer -from .base import DataLayerFactory, MapFactory, UserFactory -from umap.models import Licence, TileLayer +from .base import ( + DataLayerFactory, + MapFactory, + UserFactory, + TileLayerFactory, + LicenceFactory, +) TMP_ROOT = tempfile.mkdtemp() @@ -37,8 +42,7 @@ def user2(): @pytest.fixture def licence(): - # Should be created by the migrations. - return Licence.objects.last() + return LicenceFactory() @pytest.fixture @@ -73,4 +77,4 @@ def datalayer(map): @pytest.fixture def tilelayer(): - return TileLayer.objects.last() + return TileLayerFactory() diff --git a/umap/tests/integration/test_basics.py b/umap/tests/integration/test_basics.py index 9f9e6755..206cc785 100644 --- a/umap/tests/integration/test_basics.py +++ b/umap/tests/integration/test_basics.py @@ -18,7 +18,7 @@ def test_create_map_link(page, live_server, lang, link_name, link_url): expect(create_map_button).to_have_attribute("href", link_url) -def test_create_map_with_cursor(page, live_server): +def test_create_map_with_cursor(page, live_server, tilelayer): page.goto(f"{live_server.url}/en/map/new/") # Click on the Draw a marker button on a new map.