Example #1
0
    def import_from_api(self, movie_title="Frozen"):
        self.success_imports += 1
        if USE_MOCKS:
            OMDBApiService._request_api = mocks.OMDBMock._request_api_success
        OMDBApiService.import_movie(movie_title, "")

        movie = models.Movie.objects.get(title=movie_title)

        pprint(movie.__dict__)
        pprint(movie.genre.all())
        pprint(movie.actors.all())
        pprint(movie.director.all())
        self.assertIsNotNone(movie)
Example #2
0
 def test_import_error(self):
     if USE_MOCKS:
         OMDBApiService._request_api = mocks.OMDBMock._request_api_error
     OMDBApiService.import_movie("no_real_movie", "")
     self.assertEqual(0, models.Movie.objects.count())