Revision 9446e7e5 snf-cyclades-app/synnefo/api/test/servers.py
b/snf-cyclades-app/synnefo/api/test/servers.py | ||
---|---|---|
315 | 315 |
request = deepcopy(self.request) |
316 | 316 |
request["server"]["networks"] = [bnet3.network.id, bnet4.network.id] |
317 | 317 |
with override_settings(settings, |
318 |
DEFAULT_INSTANCE_NETWORKS=["public", bnet1.network.id,
|
|
318 |
DEFAULT_INSTANCE_NETWORKS=["SNF:ANY_PUBLIC", bnet1.network.id,
|
|
319 | 319 |
bnet2.network.id]): |
320 | 320 |
with mocked_quotaholder(): |
321 | 321 |
response = self.mypost('servers', 'test_user', |
... | ... | |
359 | 359 |
# test connect to public netwok |
360 | 360 |
request = deepcopy(self.request) |
361 | 361 |
request["server"]["networks"] = [self.network.id] |
362 |
with override_settings(settings, DEFAULT_INSTANCE_NETWORKS=["public"]): |
|
362 |
with override_settings(settings, |
|
363 |
DEFAULT_INSTANCE_NETWORKS=["SNF:ANY_PUBLIC"]): |
|
363 | 364 |
response = self.mypost('servers', 'test_user', |
364 | 365 |
json.dumps(request), 'json') |
365 | 366 |
self.assertFault(response, 403, "forbidden") |
366 | 367 |
# test wrong user |
367 | 368 |
request = deepcopy(self.request) |
368 | 369 |
request["server"]["networks"] = [bnet3.network.id] |
369 |
with override_settings(settings, DEFAULT_INSTANCE_NETWORKS=["public"]): |
|
370 |
with override_settings(settings, |
|
371 |
DEFAULT_INSTANCE_NETWORKS=["SNF:ANY_PUBLIC"]): |
|
370 | 372 |
with mocked_quotaholder(): |
371 | 373 |
response = self.mypost('servers', 'dummy_user', |
372 | 374 |
json.dumps(request), 'json') |
Also available in: Unified diff