Refactor CRUD module imports and usage for clarity.
Replaces ambiguous shorthand references like `event` and `user` with more descriptive names such as `event_crud` and `user_crud`. Updates imports, function calls, tests, and other references across the codebase to maintain consistency. This improves code readability and reduces potential confusion.
This commit is contained in:
@@ -533,7 +533,7 @@ class TestGetEvent:
|
||||
manager_user = self.create_mock_user(email="manager@example.com")
|
||||
mocked_event = self.create_mock_event(created_by=self.mock_user.id, managers=[manager_user], is_public=True)
|
||||
|
||||
self.client.user = manager_user
|
||||
self.client.user_crud = manager_user
|
||||
|
||||
endpoint = self.get_event_endpoint(mocked_event)
|
||||
response = self.client.get(endpoint)
|
||||
@@ -546,7 +546,7 @@ class TestGetEvent:
|
||||
|
||||
mocked_event = self.create_mock_event(created_by=self.mock_user.id, is_public=True)
|
||||
|
||||
self.client.user = superuser
|
||||
self.client.user_crud = superuser
|
||||
|
||||
endpoint = self.get_event_endpoint(mocked_event)
|
||||
response = self.client.get(endpoint)
|
||||
@@ -571,7 +571,7 @@ class TestGetEvent:
|
||||
is_public=True
|
||||
)
|
||||
|
||||
self.client.user = other_user
|
||||
self.client.user_crud = other_user
|
||||
|
||||
endpoint = self.get_event_endpoint(mocked_event)
|
||||
response = self.client.get(endpoint)
|
||||
@@ -598,7 +598,7 @@ class TestGetEvent:
|
||||
self.db_session.add(guest_entry)
|
||||
self.db_session.commit()
|
||||
|
||||
self.client.user = guest_user
|
||||
self.client.user_crud = guest_user
|
||||
|
||||
endpoint = self.get_event_endpoint(mocked_event)
|
||||
response = self.client.get(endpoint)
|
||||
@@ -616,7 +616,7 @@ class TestGetEvent:
|
||||
is_public=False
|
||||
)
|
||||
|
||||
self.client.user = other_user
|
||||
self.client.user_crud = other_user
|
||||
|
||||
endpoint = self.get_event_endpoint(mocked_event, access_code="123")
|
||||
response = self.client.get(endpoint)
|
||||
@@ -636,7 +636,7 @@ class TestGetEvent:
|
||||
user=None,
|
||||
)
|
||||
|
||||
self.client.user = None # Simulate no authenticated user
|
||||
self.client.user_crud = None # Simulate no authenticated user
|
||||
|
||||
endpoint = self.get_event_endpoint(mocked_event)
|
||||
response = client.get(endpoint)
|
||||
|
||||
Reference in New Issue
Block a user