Compare commits

..

No commits in common. "d6ba4ac5c5a85f757d73cd3a14b13f67c59192d6" and "78ee0709693ff833620b96f1598e4812653d4887" have entirely different histories.

8 changed files with 6 additions and 21 deletions

View file

@ -1,10 +1,5 @@
# Changelog # Changelog
## 2.7.3 - 2024-12-10
### Bug fixes
* correctly reset Dialogs returnValue by @davidbgk in #2356
## 2.7.2 - 2024-11-15 ## 2.7.2 - 2024-11-15
### Bug fixes ### Bug fixes

View file

@ -1,5 +1,5 @@
[build-system] [build-system]
requires = ["hatchling>=1.26.1"] requires = ["hatchling"]
build-backend = "hatchling.build" build-backend = "hatchling.build"
[project] [project]

View file

@ -1 +1 @@
VERSION = "2.7.3" VERSION = "2.7.2"

View file

@ -78,6 +78,7 @@ export default class Dialog extends WithTemplate {
event.preventDefault() event.preventDefault()
this.dialog.returnValue = 'accept' this.dialog.returnValue = 'accept'
this.close() this.close()
this.dialog.returnValue = undefined
}) })
} }
this.dialog.addEventListener('keydown', (e) => { this.dialog.addEventListener('keydown', (e) => {
@ -142,7 +143,6 @@ export default class Dialog extends WithTemplate {
close() { close() {
this.toggle(false) this.toggle(false)
this.dialog.returnValue = undefined
} }
toggle(open = false) { toggle(open = false) {

View file

@ -1,6 +1,5 @@
import copy import copy
import json import json
from pathlib import Path
import factory import factory
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
@ -41,7 +40,7 @@ class LicenceFactory(factory.django.DjangoModelFactory):
class TileLayerFactory(factory.django.DjangoModelFactory): class TileLayerFactory(factory.django.DjangoModelFactory):
name = "Test zoom layer" name = "Test zoom layer"
url_template = "https://{s}.test.org/osmfr/{z}/{x}/{y}.png" url_template = "http://{s}.test.org/{z}/{x}/{y}.png"
attribution = "Test layer attribution" attribution = "Test layer attribution"
class Meta: class Meta:
@ -151,8 +150,3 @@ def login_required(response):
redirect_url = reverse("login") redirect_url = reverse("login")
assert j["login_required"] == redirect_url assert j["login_required"] == redirect_url
return True return True
def mock_tiles(route):
path = Path(__file__).parent / "fixtures/empty_tile.png"
route.fulfill(path=path)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 B

View file

@ -6,8 +6,6 @@ from pathlib import Path
import pytest import pytest
from playwright.sync_api import expect from playwright.sync_api import expect
from ..base import mock_tiles
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
def browser_context_args(browser_context_args): def browser_context_args(browser_context_args):
@ -25,7 +23,7 @@ def set_timeout(context):
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def mock_osm_tiles(page): def mock_osm_tiles(page):
if not bool(os.environ.get("PWDEBUG", False)): if not bool(os.environ.get("PWDEBUG", False)):
page.route("*/**/osmfr/**", mock_tiles) page.route("*/**/osmfr/**", lambda route: route.fulfill())
@pytest.fixture @pytest.fixture

View file

@ -1,4 +1,5 @@
import json import json
import os
import platform import platform
import re import re
from pathlib import Path from pathlib import Path
@ -9,7 +10,6 @@ from playwright.sync_api import expect
from umap.models import DataLayer from umap.models import DataLayer
from ..base import mock_tiles
from .helpers import save_and_get_json from .helpers import save_and_get_json
pytestmark = pytest.mark.django_db pytestmark = pytest.mark.django_db
@ -72,8 +72,6 @@ def test_umap_import_from_file(live_server, tilelayer, page):
def test_umap_import_from_textarea(live_server, tilelayer, page, settings): def test_umap_import_from_textarea(live_server, tilelayer, page, settings):
page.route("https://tile.openstreetmap.fr/hot/**", mock_tiles)
settings.UMAP_ALLOW_ANONYMOUS = True settings.UMAP_ALLOW_ANONYMOUS = True
page.goto(f"{live_server.url}/map/new/") page.goto(f"{live_server.url}/map/new/")
page.get_by_role("button", name="Open browser").click() page.get_by_role("button", name="Open browser").click()