Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(18)  |  Call(18)  |  Derive(0)  |  Import(0)

src/p/y/pyramid-views-1.0.3/tests/test_edit.py   pyramid-views(Download)
        ))
        self.assertEqual(res.status_code, 302)
        self.assertRedirects(res, '/list/authors/')
        self.assertQuerysetEqual(Session.query(Author).all(), ['<Author: Randall Munroe>'])
 
        self.assertEqual(res.status_code, 302)
        artist = Session.query(Artist).filter(Artist.name=='Rene Magritte').one()
        self.assertRedirects(res, '/detail/artist/%d/' % artist.id)
        self.assertQuerysetEqual(Session.query(Artist).all(), ['<Artist: Rene Magritte>'])
 
        ))
        self.assertEqual(res.status_code, 302)
        self.assertRedirects(res, '/edit/authors/create/')
        self.assertQuerysetEqual(Session.query(Author).all(), ['<Author: Randall Munroe>'])
 
        self.assertEqual(res.status_code, 302)
        id = Session.query(Author).all()[0].id
        self.assertRedirects(res, '/edit/author/%d/update/' % id)
 
    def test_create_with_special_properties(self):
        self.assertEqual(res.status_code, 302)
        obj = Session.query(Author).filter(Author.slug=='randall-munroe').one()
        self.assertRedirects(res, '/detail/author/%s/' % obj.id)
        self.assertQuerysetEqual(Session.query(Author).all(), ['<Author: Randall Munroe>'])