Exemple #1
0
 def test_get_empty(self):
     """test GET all movies when database is empty"""
     all_movies = Movie.select()
     self.assertEqual(0, len(all_movies))
     res = self.test_client.get('http://localhost:5555/movie/')
     self.assertEqual(res.status_code, 200)
Exemple #2
0
 def test_post_4(self):
     """ POST with missing genre"""
     payload = {'title': 'gone with the wind'}
     res = self.post_json('http://localhost:5555/movie/', payload)
     self.assertEqual(res.status_code, 400)
     self.assertEqual(len(Movie.select()), 0)