def test_get_exists(self): rep = SeanceRepository() seance_id = rep.create('5bd89b59af13c757e1b7f3fd', '01.01.2018_12:00', 5) seance1 = rep.get(seance_id) seance2 = Seance(seance_id=fields.ObjectId(seance_id), movie_id=fields.ObjectId('5bd89b59af13c757e1b7f3fd'), date_time='01.01.2018_12:00', seats=[True, True, True, True, True]) self.assertEqual(seance1, seance2) rep.delete(seance_id)
def test_get_right(self): rep = MovieRepository() movie_id = rep.create('a', 'a', 100) movie1 = rep.get(movie_id) movie2 = Movie(movie_id=fields.ObjectId(movie_id), name='a', description='a', length=100) self.assertEqual(movie1, movie2) rep.delete(movie_id)
def test_get_right(self): rep = TicketRepository() ticket_id = rep.create(seance_id='5bd897f8af13c78fe908cb98', seat_number=1) ticket1 = rep.get(ticket_id) ticket2 = Ticket(ticket_id=fields.ObjectId(ticket_id), seance_id='5bd897f8af13c78fe908cb98', seat_number=1) self.assertEqual(ticket1, ticket2) rep.delete(ticket_id)
def test_get_right(self): rep = ProdRepository() prod_id = rep.create(mag_id='5bfbb05b102bd23cdc85f75a', prod_col=1) prod1 = rep.get(prod_id) prod2 = Prod(prod_id=fields.ObjectId(prod_id), mag_id='5bfbb05b102bd23cdc85f75a', prod_col=1) self.assertEqual(prod1, prod2) rep.delete(prod_id)
def test_get_right(self): rep = KassirRepository() kassir_id = rep.create('a', 'a', 100) kassir1 = rep.get(kassir_id) kassir2 = Kassir(kassir_id=fields.ObjectId(kassir_id), name='a', razryad='a', year=100) self.assertEqual(kassir1, kassir2) rep.delete(kassir_id)
def test_get_right(self): rep = UserRepository() user_id = rep.create('name', 'password') user1 = rep.get(user_id) user2 = User(user_id=fields.ObjectId(user_id), ticket_ids=[], name='name', password='******') self.assertEqual(user1, user2) rep.delete(user_id)
def test_get_right(self): rep = MehRepository() meh_id = rep.create('a', 'a', '100') meh1 = rep.get(meh_id) meh2 = Mechanic(meh_id=fields.ObjectId(meh_id), name='a', lvl='a', year='100') self.assertEqual(meh1, meh2) rep.delete(meh_id)
def test_get_right(self): rep = CarRepository() car_id = rep.create(fix_id='1488322', user_id='3212313', name='opel') car1 = rep.get(car_id) car2 = Car(car_id=fields.ObjectId(car_id), fix_id='1488322', user_id='3212313', name='opel') self.assertEqual(car1, car2) rep.delete(car_id)