Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
fix absolute url reverse bug in for building
Browse files Browse the repository at this point in the history
  • Loading branch information
evildmp committed Jul 30, 2013
1 parent 7823a9e commit 83d859a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contacts_and_people/models.py
Expand Up @@ -115,7 +115,7 @@ def __unicode__(self):


def get_absolute_url(self):
return reverse("contact_place", kwargs={"slug":self.slug})
return reverse("contact-place", kwargs={"slug":self.slug})

def save(self):
if not self.slug or self.slug == '':
Expand Down
14 changes: 14 additions & 0 deletions contacts_and_people/tests.py
Expand Up @@ -46,6 +46,20 @@ def test_building_and_map_settings(self):
self.main_building.save()
self.assertEquals(self.cardiff.maps, [self.main_building])

def test_get_absolute_url(self):
# give the building a map
self.main_building = Building(
name="Main Building",
street="St Mary's Street",
site=self.cardiff,
)
self.main_building.save()
self.assertEquals(
self.main_building.get_absolute_url(),
"/place/main-building-main-site/"
)


class EntityManagerTests(TestCase):
def setUp(self):
pass
Expand Down

0 comments on commit 83d859a

Please sign in to comment.