예제 #1
0
    def test_searchMovies_getMovieNoneScope_MoviesNotExists(self):
        scope = None
        search = 'Почему'
        movies = MovieQuery.searchMovies(scope, search)

        result = []
        self.assertEquals(list(movies), list(result))
예제 #2
0
    def test_searchMovies_getMovieWrongSearch_MoviesNotExists(self):
        scope = Movie.object.order_by("-created_date")
        search = 'Почему'
        movies = MovieQuery.searchMovies(scope, search)

        result = Movie.object.filter(movie_name__iregex='Почему')
        self.assertEquals(list(movies), list(result))
예제 #3
0
    def test_searchMovies_getMovieNoneSearch_MoviesNotExists(self):
        scope = Movie.object.order_by("-created_date")
        search = None
        movies = MovieQuery.searchMovies(scope, search)

        result = []
        self.assertEquals(list(movies), list(result))
예제 #4
0
    def test_searchMovies_getMovieCorrectSearch_MovieCorrect(self):
        scope = Movie.object.order_by("-created_date")
        search = 'Почему он?'
        movies = MovieQuery.searchMovies(scope, search)

        result = Movie.object.filter(movie_name='Почему он?')
        self.assertEquals(list(movies), list(result))