Browse files

fix absolute url reverse bug in for building

  • Loading branch information...
1 parent 7823a9e commit 83d859a1cf951233be5c06827e7b8c0fdadbcfcc @evildmp committed Jul 30, 2013
Showing with 15 additions and 1 deletion.
  1. +1 −1 contacts_and_people/models.py
  2. +14 −0 contacts_and_people/tests.py
View
2 contacts_and_people/models.py
@@ -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 == '':
View
14 contacts_and_people/tests.py
@@ -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

0 comments on commit 83d859a

Please sign in to comment.