Skip to content

Commit

Permalink
✅ [#32] Add test for is_local_url
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Apr 16, 2024
1 parent e3325e7 commit dd74325
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion testapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ def get_db():

ROOT_URLCONF = "testapp.urls"

ALLOWED_HOSTS = ["testserver.com"]
ALLOWED_HOSTS = ["testserver.com", "testserver.local"]

USE_TZ = False
6 changes: 6 additions & 0 deletions tests/test_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@ def test_failed_not_json():

with pytest.raises(FetchJsonError):
default_loader.load("https://example.com", ZaakType)


def test_is_local_url():
assert default_loader.is_local_url("https://testserver.com/some-resource")
assert default_loader.is_local_url("https://testserver.local:443/some-resource")
assert not default_loader.is_local_url("https://example.com/some-resource")

0 comments on commit dd74325

Please sign in to comment.