Example #1
0
    def test_user_can_update_reservation_with_valid_data(self):
        self.reservation.paid = True
        self.reservation.save()
        self.client.login(username=self.user.email, password='******')

        start = self.reservation.start + timedelta(hours=1)
        end = self.reservation.end + timedelta(hours=1)
        data = {
            'start': start.strftime('%Y-%m-%d %H'),
            'end': end.strftime('%Y-%m-%d %H'),
            'field': self.reservation.field.id
        }

        response = self.client.post(self.detail_url + 'confirm/', data)
        self.assertRedirects(response, ReservationFactory.get_reservation_history_url())
Example #2
0
    def test_user_can_update_reservation_with_valid_data(self):
        self.reservation.paid = True
        self.reservation.save()
        self.client.login(username=self.user.email, password='******')

        start = self.reservation.start + timedelta(hours=1)
        end = self.reservation.end + timedelta(hours=1)
        data = {
            'start': start.strftime('%Y-%m-%d %H'),
            'end': end.strftime('%Y-%m-%d %H'),
            'field': self.reservation.field.id
        }

        response = self.client.post(self.detail_url + 'confirm/', data)
        self.assertRedirects(response,
                             ReservationFactory.get_reservation_history_url())
Example #3
0
 def setUp(self):
     self.user = UserFactory(is_active=True)
     self.history_url = ReservationFactory.get_reservation_history_url()
Example #4
0
 def setUp(self):
     self.user = UserFactory(is_active=True)
     self.history_url = ReservationFactory.get_reservation_history_url()