예제 #1
0
    def test_movie_create(self):
        res = MovieService.create(movie_schema.load(self.movie1))

        json_data = json.loads(res.data)
        self.assertEqual(res.status_code, 201)
        self.assertEqual(json_data['title'], 'Star Wars')

        res = MovieService.get_all()

        json_data = json.loads(res.data)
        self.assertEqual(res.status_code, 200)
        self.assertEqual(json_data.__len__(), 1)
예제 #2
0
 def post(self):
     """Create Movie"""
     return MovieService.create(request.parsed_obj)