def create_location_authority(): location_authority = LocationAuthority( name='Geonames', namespace='http://www.geonames.org', host='http://api.geonames.org', retrieveformat='/get?geonameId={0}&username=erickpeirson&style=full', id_pattern='http://www.geonames.org/(.*?)/') location_authority.save() return location_authority
def create_location_authority(): location_authority = LocationAuthority( name='Geonames', namespace='http://www.geonames.org', host='http://api.geonames.org', retrieveformat='/get?geonameId={0}&username=erickpeirson&style=full', id_pattern='http://www.geonames.org/(.*?)/' ) location_authority.save() return location_authority
def test_namespace_unique(self): """ the namespace column must be unique """ la = LocationAuthority(name='testAuthority', host='testHost', namespace='testNamespace', retrieveformat='testFormat', id_pattern='testPattern') la.save() la2 = LocationAuthority(name='testAuthority', host='testHost', namespace='testNamespace', retrieveformat='testFormat', id_pattern='testPattern') self.assertRaises(IntegrityError, la2.save)
def test_namespace_unique(self): """ the namespace column must be unique """ la = LocationAuthority( name='testAuthority', host='testHost', namespace='testNamespace', retrieveformat='testFormat', id_pattern='testPattern') la.save() la2 = LocationAuthority( name='testAuthority', host='testHost', namespace='testNamespace', retrieveformat='testFormat', id_pattern='testPattern') self.assertRaises(IntegrityError, la2.save)