-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from arthur-schnitzler/main
fall back to GND or Geonames if no Wikidata for given Place URI exists
- Loading branch information
Showing
7 changed files
with
165 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
POSTGRES_DB=pmb_play | ||
POSTGRES_DB=pmb | ||
# NEW_PMB=True | ||
# POSTGRES_HOST=172.17.0.1 | ||
DEBUG=True | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[settings] | ||
multi_line_output=3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from django.test import TestCase | ||
|
||
from normdata.utils import ( | ||
get_or_create_place_from_geonames, | ||
get_or_create_place_from_gnd, | ||
) | ||
|
||
GEONAMES_URL = "https://www.geonames.org/2461464/graret-oum-sedra.html" | ||
GND_URL = "http://lobid.org/gnd/4547867-3" | ||
|
||
|
||
class NormdataTestCase(TestCase): | ||
def test_001_get_or_create_place_from_geonames(self): | ||
entity = get_or_create_place_from_geonames(GEONAMES_URL) | ||
self.assertEqual(entity.name, "Graret Oum Sedra") | ||
entity = get_or_create_place_from_geonames(GEONAMES_URL) | ||
entity.delete() | ||
|
||
def test_002_get_or_create_place_from_gnd(self): | ||
entity = get_or_create_place_from_gnd(GND_URL) | ||
self.assertEqual(entity.name, "Gramastetten") | ||
entity = get_or_create_place_from_gnd(GND_URL) | ||
entity.delete() | ||
|
||
def test_002_get_or_create_place_from_gnd_no_coords(self): | ||
entity = get_or_create_place_from_gnd("http://lobid.org/gnd/10053010-2") | ||
self.assertEqual(entity.name, "Horco Molle") | ||
entity = get_or_create_place_from_gnd("http://lobid.org/gnd/10053010-2") | ||
entity.delete() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters