MCPcopy
hub / github.com/Flagsmith/flagsmith / environment

Function environment

api/tests/integration/conftest.py:118–135  ·  view source on GitHub ↗
(
    admin_client: APIClient,
    project: int,
    environment_api_key: str,
    environment_name: str,
    settings: SettingsWrapper,
)

Source from the content-addressed store, hash-verified

116
117@pytest.fixture()
118def 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()

Callers

nothing calls this directly

Calls 3

reverseFunction · 0.50
postMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected