Ejemplo n.º 1
0
    def test_sortMovie_getMoviesNoneScope_MoviesDate(self):
        scope = None
        sort = "image"
        movies = MovieQuery.sortMovie(scope, sort)

        result = []
        self.assertEquals(list(movies), list(result))
Ejemplo n.º 2
0
    def test_sortMovie_getMoviesNoneSort_MoviesNotExists(self):
        scope = Movie.object.order_by("-created_date")
        sort = None
        movies = MovieQuery.sortMovie(scope, sort)

        result = Movie.object.order_by("-created_date")
        self.assertEquals(list(movies), list(result))
Ejemplo n.º 3
0
    def test_sortMovie_getMoviesWrongSort_MoviesDate(self):
        scope = Movie.object.order_by("-created_date")
        sort = "image"
        movies = MovieQuery.sortMovie(scope, sort)

        result = Movie.object.order_by("-created_date")
        self.assertEquals(list(movies), list(result))
Ejemplo n.º 4
0
    def test_sortMovie_getMoviesCorrectSort_MoviesAlphabet(self):
        scope = Movie.object.order_by("-created_date")
        sort = 'Alphabet'
        movies = MovieQuery.sortMovie(scope, sort)

        result = Movie.object.order_by('movie_name')
        self.assertEquals(list(movies), list(result))