Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ezkat committed Oct 11, 2023
1 parent e7c8db5 commit 393c277
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions resources/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,10 @@ def strong_resource(resource_with_opening_hours):
@pytest.fixture
def resource_with_reservation_reminders(
resource_with_opening_hours,
metadataset_1,
test_unit_with_reminders_enabled):
resource_with_opening_hours.unit = test_unit_with_reminders_enabled
resource_with_opening_hours.reservation_metadata_set = metadataset_1
resource_with_opening_hours.save()
return resource_with_opening_hours

Expand Down
12 changes: 8 additions & 4 deletions resources/tests/test_reservation_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3277,11 +3277,15 @@ def test_reservation_not_allowed_during_maintenance_mode(

@pytest.mark.django_db
def test_reservation_reminder_create(
api_client, user, list_url, reservation_data_extra,
api_client, user, list_url, reservation_data,
resource_with_reservation_reminders):
api_client.force_authenticate(user=user)
reservation_data_extra['resource'] = resource_with_reservation_reminders.pk
reservation_data_extra['reserver_phone_number'] = '+358404040404'
response = api_client.post(list_url, data=reservation_data_extra, HTTP_ACCEPT_LANGUAGE='en')
reservation_data['resource'] = resource_with_reservation_reminders.pk
reservation_data['begin'] = '2115-04-04T09:00:00+02:00'
reservation_data['end'] = '2115-04-04T10:00:00+02:00'
reservation_data['reserver_name'] = 'Nordea Demo'
reservation_data['reserver_email_address'] = '[email protected]'
reservation_data['reserver_phone_number'] = '+358404040404'
response = api_client.post(list_url, data=reservation_data, HTTP_ACCEPT_LANGUAGE='en')
assert response.status_code == 201
assert ReservationReminder.objects.count() == 1

0 comments on commit 393c277

Please sign in to comment.