Beispiel #1
0
    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')
Beispiel #2
0
    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')
Beispiel #3
0
 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)
Beispiel #4
0
 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)