示例#1
0
文件: tests.py 项目: thuvh/filmmaster
    def test_get_films_in_cinemas2(self):
        """ Tests situation when there are showtimes in the given country.
        """

        self.initialize()
        time_now = datetime.datetime.utcnow() + datetime.timedelta(0.1)

        self.warsaw = Town(country=self.poland, name='Warsaw',
                has_cinemas=True)
        self.warsaw.save()

        self.cinema_ww = Channel(type=TYPE_CINEMA, town=self.warsaw, address='Marszalkowska 2')
        self.cinema_ww.save()

        self.screen_ww1 = Screening(channel=self.cinema_ww, film=self.fc5,
                utc_time=time_now)
        self.screen_ww1.save()

        self.screen_ww2 = Screening(channel=self.cinema_ww, film=self.fc7,
                utc_time=time_now)
        self.screen_ww2.save()

        country_films = set([f.id for f in \
                get_films_in_cinemas_by_country(country_code='PL')])
        self.assertTrue(self.f7.id in country_films)
示例#2
0
    def test_get_films_in_cinemas2(self):
        """ Tests situation when there are showtimes in the given country.
        """

        self.initialize()
        time_now = datetime.datetime.utcnow() + datetime.timedelta(0.1)

        self.warsaw = Town(country=self.poland,
                           name='Warsaw',
                           has_cinemas=True)
        self.warsaw.save()

        self.cinema_ww = Channel(type=TYPE_CINEMA,
                                 town=self.warsaw,
                                 address='Marszalkowska 2')
        self.cinema_ww.save()

        self.screen_ww1 = Screening(channel=self.cinema_ww,
                                    film=self.fc5,
                                    utc_time=time_now)
        self.screen_ww1.save()

        self.screen_ww2 = Screening(channel=self.cinema_ww,
                                    film=self.fc7,
                                    utc_time=time_now)
        self.screen_ww2.save()

        country_films = set([f.id for f in \
                get_films_in_cinemas_by_country(country_code='PL')])
        self.assertTrue(self.f7.id in country_films)
示例#3
0
文件: tests.py 项目: thuvh/filmmaster
    def test_get_films_in_cinemas1(self):
        """ Tests situation when there are no showtimes in the given country.
            Takes USA as a default then.
        """

        self.initialize()

        country_films = set([f.id for f in \
                get_films_in_cinemas_by_country(country_code='CR')])
        self.assertTrue(self.f4.id in country_films)
示例#4
0
    def test_get_films_in_cinemas1(self):
        """ Tests situation when there are no showtimes in the given country.
            Takes USA as a default then.
        """

        self.initialize()

        country_films = set([f.id for f in \
                get_films_in_cinemas_by_country(country_code='CR')])
        self.assertTrue(self.f4.id in country_films)