def test_entity_update_updates_slug(self): entity = fac.entity() # Sanity check self.assertEqual(entity.slug, 'argos') entity.name = 'foo bar' save() self.assertEqual(entity.slug, 'foo-bar')
def test_GET_entity(self): entity = fac.entity() r = self.client.get('/entities/{0}'.format(entity.slug)) expected = { 'name': entity.name, 'slug': entity.slug, 'url': '/entities/{0}'.format(entity.slug), 'updated_at': entity.updated_at.isoformat(), 'stories': [] } self.assertEqual(self.json(r), expected)
def test_GET_entity(self): entity = fac.entity() r = self.client.get("/entities/{0}".format(entity.slug)) expected = { "name": entity.name, "slug": entity.slug, "url": "/entities/{0}".format(entity.slug), "updated_at": entity.updated_at.isoformat(), "stories": [], } self.assertEqual(self.json(r), expected)