Skip to content

Commit

Permalink
Solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman-Sokolov-V committed Dec 14, 2024
1 parent 99652fb commit 7578400
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cinema/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def clean(self):
row=self.row,
seat=self.seat,
movie_session=self.movie_session,
error_to_raise=ValueError
error_to_raise=ValidationError
)

def save(
Expand Down
3 changes: 1 addition & 2 deletions cinema/tests/test_movie_session_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def test_get_movie_sessions_filtered_by_movie(self):

def test_get_movie_sessions_filtered_by_movie_and_data(self):
movie_sessions = self.client.get(
f"/api/cinema/movie_sessions/?movie="
f"{self.movie.id}&date=2022-09-2"
f"/api/cinema/movie_sessions/?movie="{self.movie.id}&date=2022-09-2"
)
self.assertEqual(movie_sessions.status_code, status.HTTP_200_OK)
self.assertEqual(len(movie_sessions.data), 1)
Expand Down
1 change: 0 additions & 1 deletion cinema/tests/test_order_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def test_movie_session_detail_tickets(self):

def test_movie_session_list_tickets_available(self):
response = self.client.get(f"/api/cinema/movie_sessions/")
print(response.data)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(
response.data[0]["tickets_available"],
Expand Down
2 changes: 1 addition & 1 deletion cinema_service/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
SECRET_KEY = os.getenv("SECRET_KEY", "your_sekreat_key")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.getenv("DEBUG", "True") == "True"
DEBUG = os.getenv("DEBUG", "False") == "True"

ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS", "localhost").split(",")

Expand Down

0 comments on commit 7578400

Please sign in to comment.