Ejemplo n.º 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')
Ejemplo n.º 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')
Ejemplo n.º 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)
Ejemplo n.º 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)