Compare commits

...

4 commits

Author SHA1 Message Date
Yohan Boniface
d6ba4ac5c5 Explicit hatchling version for build
cf https://github.com/pypa/hatch/issues/1818#issuecomment-2488731301
2024-12-10 14:08:24 +01:00
Yohan Boniface
1f6d6c4d9b 2.7.3 2024-12-10 13:55:32 +01:00
Yohan Boniface
8a5ad799ce chore: fix failing test 2024-12-10 13:54:50 +01:00
David Larlet
eeaaf0c612 fix(#2355): correctly reset Dialog’s returnValue
Fixes #2355
2024-12-10 13:34:48 +01:00
8 changed files with 21 additions and 6 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

BIN
umap/tests/fixtures/empty_tile.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 B

View file

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

View file

@ -1,5 +1,4 @@
import json
import os
import platform
import re
from pathlib import Path
@ -10,6 +9,7 @@ from playwright.sync_api import expect
from umap.models import DataLayer
from ..base import mock_tiles
from .helpers import save_and_get_json
pytestmark = pytest.mark.django_db
@ -72,6 +72,8 @@ def test_umap_import_from_file(live_server, tilelayer, page):
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
page.goto(f"{live_server.url}/map/new/")
page.get_by_role("button", name="Open browser").click()