| 116 | |
| 117 | @pytest.fixture() |
| 118 | def environment( |
| 119 | admin_client: APIClient, |
| 120 | project: int, |
| 121 | environment_api_key: str, |
| 122 | environment_name: str, |
| 123 | settings: SettingsWrapper, |
| 124 | ) -> int: |
| 125 | settings.EDGE_RELEASE_DATETIME = None |
| 126 | environment_data = { |
| 127 | "name": environment_name, |
| 128 | "api_key": environment_api_key, |
| 129 | "project": project, |
| 130 | "allow_client_traits": True, |
| 131 | } |
| 132 | url = reverse("api-v1:environments:environment-list") |
| 133 | |
| 134 | response = admin_client.post(url, data=environment_data) |
| 135 | return response.json()["id"] # type: ignore[no-any-return] |
| 136 | |
| 137 | |
| 138 | @pytest.fixture() |