|
@@ -167,14 +167,15 @@ class CustomLinkTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|
|
'weight': 100,
|
|
'weight': 100,
|
|
|
'button_class': CustomLinkButtonClassChoices.DEFAULT,
|
|
'button_class': CustomLinkButtonClassChoices.DEFAULT,
|
|
|
'link_text': 'Link X',
|
|
'link_text': 'Link X',
|
|
|
- 'link_url': 'http://example.com/?x'
|
|
|
|
|
|
|
+ 'link_url': 'http://example.com/?x',
|
|
|
|
|
+ 'restricted': True,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
cls.csv_data = (
|
|
cls.csv_data = (
|
|
|
- "name,object_types,enabled,weight,button_class,link_text,link_url",
|
|
|
|
|
- "Custom Link 4,dcim.site,True,100,blue,Link 4,http://exmaple.com/?4",
|
|
|
|
|
- "Custom Link 5,dcim.site,True,100,blue,Link 5,http://exmaple.com/?5",
|
|
|
|
|
- "Custom Link 6,dcim.site,False,100,blue,Link 6,http://exmaple.com/?6",
|
|
|
|
|
|
|
+ "name,object_types,enabled,weight,button_class,link_text,link_url,restricted",
|
|
|
|
|
+ "Custom Link 4,dcim.site,True,100,blue,Link 4,http://exmaple.com/?4,True",
|
|
|
|
|
+ "Custom Link 5,dcim.site,True,100,blue,Link 5,http://exmaple.com/?5,False",
|
|
|
|
|
+ "Custom Link 6,dcim.site,False,100,blue,Link 6,http://exmaple.com/?6,",
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
cls.csv_update_data = (
|
|
cls.csv_update_data = (
|
|
@@ -188,6 +189,7 @@ class CustomLinkTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|
|
'button_class': CustomLinkButtonClassChoices.CYAN,
|
|
'button_class': CustomLinkButtonClassChoices.CYAN,
|
|
|
'enabled': False,
|
|
'enabled': False,
|
|
|
'weight': 200,
|
|
'weight': 200,
|
|
|
|
|
+ 'restricted': True,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -661,14 +663,15 @@ class ExportTemplateTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|
|
'template_code': TEMPLATE_CODE,
|
|
'template_code': TEMPLATE_CODE,
|
|
|
'environment_params': ENVIRONMENT_PARAMS,
|
|
'environment_params': ENVIRONMENT_PARAMS,
|
|
|
'file_name': 'template_x',
|
|
'file_name': 'template_x',
|
|
|
|
|
+ 'restricted': True,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
cls.csv_data = {
|
|
cls.csv_data = {
|
|
|
'default': (
|
|
'default': (
|
|
|
- "name,object_types,template_code,file_name",
|
|
|
|
|
- f"Export Template 4,dcim.site,{TEMPLATE_CODE},",
|
|
|
|
|
- f"Export Template 5,dcim.site,{TEMPLATE_CODE},template_5",
|
|
|
|
|
- f"Export Template 6,dcim.site,{TEMPLATE_CODE},",
|
|
|
|
|
|
|
+ "name,object_types,template_code,file_name,restricted",
|
|
|
|
|
+ f"Export Template 4,dcim.site,{TEMPLATE_CODE},,True",
|
|
|
|
|
+ f"Export Template 5,dcim.site,{TEMPLATE_CODE},template_5,False",
|
|
|
|
|
+ f"Export Template 6,dcim.site,{TEMPLATE_CODE},,",
|
|
|
),
|
|
),
|
|
|
'with_data_file': (
|
|
'with_data_file': (
|
|
|
"name,object_types,data_file,auto_sync_enabled",
|
|
"name,object_types,data_file,auto_sync_enabled",
|
|
@@ -691,6 +694,7 @@ class ExportTemplateTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|
|
'mime_type': 'text/html',
|
|
'mime_type': 'text/html',
|
|
|
'file_extension': 'html',
|
|
'file_extension': 'html',
|
|
|
'as_attachment': True,
|
|
'as_attachment': True,
|
|
|
|
|
+ 'restricted': True,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
def test_bulk_import_objects_with_permission(self):
|
|
def test_bulk_import_objects_with_permission(self):
|
|
@@ -889,14 +893,15 @@ class WebhookTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|
|
'http_method': 'GET',
|
|
'http_method': 'GET',
|
|
|
'http_content_type': 'application/foo',
|
|
'http_content_type': 'application/foo',
|
|
|
'timeout': 45,
|
|
'timeout': 45,
|
|
|
|
|
+ 'restricted': True,
|
|
|
'description': 'My webhook',
|
|
'description': 'My webhook',
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
cls.csv_data = (
|
|
cls.csv_data = (
|
|
|
- "name,payload_url,http_method,http_content_type,timeout,description",
|
|
|
|
|
- "Webhook 4,http://example.com/?4,GET,application/json,15,Foo",
|
|
|
|
|
- "Webhook 5,http://example.com/?5,GET,application/json,,Bar",
|
|
|
|
|
- "Webhook 6,http://example.com/?6,GET,application/json,,Baz",
|
|
|
|
|
|
|
+ "name,payload_url,http_method,http_content_type,timeout,restricted,description",
|
|
|
|
|
+ "Webhook 4,http://example.com/?4,GET,application/json,15,True,Foo",
|
|
|
|
|
+ "Webhook 5,http://example.com/?5,GET,application/json,,False,Bar",
|
|
|
|
|
+ "Webhook 6,http://example.com/?6,GET,application/json,,,Baz",
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
cls.csv_update_data = (
|
|
cls.csv_update_data = (
|
|
@@ -909,6 +914,7 @@ class WebhookTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|
|
cls.bulk_edit_data = {
|
|
cls.bulk_edit_data = {
|
|
|
'http_method': 'GET',
|
|
'http_method': 'GET',
|
|
|
'timeout': 60,
|
|
'timeout': 60,
|
|
|
|
|
+ 'restricted': True,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1213,6 +1219,7 @@ class ConfigTemplateTestCase(
|
|
|
'template_code': TEMPLATE_CODE,
|
|
'template_code': TEMPLATE_CODE,
|
|
|
'environment_params': ENVIRONMENT_PARAMS,
|
|
'environment_params': ENVIRONMENT_PARAMS,
|
|
|
'file_name': 'config_x',
|
|
'file_name': 'config_x',
|
|
|
|
|
+ 'restricted': True,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
cls.csv_update_data = (
|
|
cls.csv_update_data = (
|
|
@@ -1228,6 +1235,7 @@ class ConfigTemplateTestCase(
|
|
|
'file_name': 'output',
|
|
'file_name': 'output',
|
|
|
'file_extension': 'html',
|
|
'file_extension': 'html',
|
|
|
'as_attachment': True,
|
|
'as_attachment': True,
|
|
|
|
|
+ 'restricted': True,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
def test_content_is_not_cacheable(self):
|
|
def test_content_is_not_cacheable(self):
|