コード例 #1
0
ファイル: tests.py プロジェクト: jbrengman/flask-microblog
 def test_read_post(self):
     test_title = 'Testing the title.'
     test_body = 'This is the body of the test microblog post.'
     test_cat = ''
     test_auth = 1
     microblog.write_post(test_title, test_body, test_cat, test_auth)
     expected_post = microblog.Post(
         test_title, test_body, [], test_auth)
     result_post = microblog.read_post(1)
     self.assertEqual(expected_post.title, result_post.title)
     self.assertEqual(expected_post.body, result_post.body)
コード例 #2
0
ファイル: tests.py プロジェクト: risingmoon/flask-microblog
 def test_read_post(self):
     self.setup_posts()
     for index in range(1, 5):
         self.assertTrue(read_post(index))
     with self.assertRaises(KeyError):
         read_post(6)
コード例 #3
0
ファイル: tests.py プロジェクト: sbabineau/flask-microblog
 def test_read_post(self):
     self.assertTrue(microblog.read_post(1))
コード例 #4
0
ファイル: tests.py プロジェクト: markcharyk/flask-microblog
 def testFirst(self):
     write_post(u"Newer Post", u"""
         The text containing the newer post in the blog.""", self.auth_id, self.auth_name)
     self.assertIsInstance(read_post(1), Post)
コード例 #5
0
ファイル: tests.py プロジェクト: markcharyk/flask-microblog
 def testEmpty(self):
     with self.assertRaises(IndexError):
         read_post(1)
コード例 #6
0
 def test_read_post(self):
     """Add several posts and attempt to fetch one by its id."""
     post = microblog.read_post(2)
     self.assertIn(post.title, self.posts)
     self.assertEqual(post.body, self.posts[post.title])
コード例 #7
0
ファイル: tests.py プロジェクト: tsnaomi/flask_microblog
 def test_readPost_bad_id(self):
     with self.assertRaises(KeyError):
         read_post(9)
         read_post('POEM')
コード例 #8
0
ファイル: tests.py プロジェクト: tsnaomi/flask_microblog
 def test_readPost(self):
     self.POETRY()
     self.assertEqual(Post.query.all()[3], read_post(4))