Example #1
0
 def test_user_cannot_update_reservation_in_past(self):
     self.client.login(username=self.user.email, password='******')
     reservation = ReservationFactory(start=timezone.now() - timedelta(minutes=15),
                                      end=timezone.now() - timedelta(hours=1, minutes=15),
                                      user=self.user, paid=True)
     response = self.client.get(ReservationFactory.get_reservation_detail_url(reservation.id))
     self.assertEqual(response.status_code, http_client.NOT_FOUND)
Example #2
0
 def test_user_cannot_update_other_user_reservation(self):
     self.client.login(username=self.user.email, password='******')
     other_reservation = ReservationFactory(paid=True)
     response = self.client.get(
         ReservationFactory.get_reservation_detail_url(
             other_reservation.id))
     self.assertEqual(response.status_code, http_client.NOT_FOUND)
Example #3
0
 def test_user_cannot_update_reservation_in_past(self):
     self.client.login(username=self.user.email, password='******')
     reservation = ReservationFactory(
         start=timezone.now() - timedelta(minutes=15),
         end=timezone.now() - timedelta(hours=1, minutes=15),
         user=self.user,
         paid=True)
     response = self.client.get(
         ReservationFactory.get_reservation_detail_url(reservation.id))
     self.assertEqual(response.status_code, http_client.NOT_FOUND)
Example #4
0
 def test_user_cannot_update_other_user_reservation(self):
     self.client.login(username=self.user.email, password='******')
     other_reservation = ReservationFactory(paid=True)
     response = self.client.get(ReservationFactory.get_reservation_detail_url(other_reservation.id))
     self.assertEqual(response.status_code, http_client.NOT_FOUND)
Example #5
0
 def setUp(self):
     self.user = UserFactory(is_active=True)
     self.reservation = ReservationFactory(user=self.user)
     self.detail_url = ReservationFactory.get_reservation_detail_url(self.reservation.id)
Example #6
0
 def setUp(self):
     self.user = UserFactory(is_active=True)
     self.reservation = ReservationFactory(user=self.user)
     self.detail_url = ReservationFactory.get_reservation_detail_url(
         self.reservation.id)