Ejemplo n.º 1
0
 def test_index_(self):
     from board.views import index_
     # Make sure that index_() does not add empty posts
     postCount = db.query(Post).count()
     info = index_(testing.DummyRequest(params={'text': u''}, post=True))
     self.assertEqual(len(info['posts']), postCount)
     # Make sure that index_() increments the number of posts
     postCount = db.query(Post).count()
     info = index_(testing.DummyRequest(params={'text': u'four'}, post=True))
     self.assertEqual(len(info['posts']), postCount + 1)
Ejemplo n.º 2
0
 def test_index_(self):
     from board.views import index_
     # Make sure that index_() does not add empty posts
     postCount = db.query(Post).count()
     info = index_(testing.DummyRequest(params={'text': u''}, post=True))
     self.assertEqual(len(info['posts']), postCount)
     # Make sure that index_() increments the number of posts
     postCount = db.query(Post).count()
     info = index_(testing.DummyRequest(params={'text': u'four'},
                                        post=True))
     self.assertEqual(len(info['posts']), postCount + 1)
Ejemplo n.º 3
0
 def test_index(self):
     from board.views import index
     # Make sure that index() returns as many posts as exist in the database
     info = index(testing.DummyRequest())
     self.assertEqual(len(info['posts']), db.query(Post).count())
Ejemplo n.º 4
0
def get_posts():
    return db.query(Post).order_by(Post.id.desc()).all()
Ejemplo n.º 5
0
 def test_index(self):
     from board.views import index
     # Make sure that index() returns as many posts as exist in the database
     info = index(testing.DummyRequest())
     self.assertEqual(len(info['posts']), db.query(Post).count())
Ejemplo n.º 6
0
def get_posts():
    return db.query(Post).order_by(Post.id.desc()).all()