Ejemplo n.º 1
0
 def test_get_all_entries(self):
     expected = ("My Title","My Text")
     with self.app.test_request_context('/'):
         self.app.preprocess_request()
         flaskr.write_entry(*expected)
         entries = flaskr.get_all_entries()
         self.assertEquals(len(entries), 1)
         for entry in entries:
             self.assertEquals(expected[0], entry['title'])
             self.assertEquals(expected[1], entry['text'])
Ejemplo n.º 2
0
 def test_get_all_entries_empty(self):
     with self.app.test_request_context('/'):
         self.app.preprocess_request()
         entries = flaskr.get_all_entries()
         self.assertEquals(len(entries), 0)