Ejemplo n.º 1
0
def test_disable_post_on_v1_inventory_source_list(version, supports_post):
    inv_source_list = InventorySourceList()
    inv_source_list.request = mock.MagicMock()
    with mock.patch('awx.api.views.get_request_version', return_value=version):
        assert ('POST' in inv_source_list.allowed_methods) == supports_post
Ejemplo n.º 2
0
    InventorySourceList,
    InventorySourceDetail,
    InventorySourceUpdateView,
    InventorySourceUpdatesList,
    InventorySourceActivityStreamList,
    InventorySourceSchedulesList,
    InventorySourceCredentialsList,
    InventorySourceGroupsList,
    InventorySourceHostsList,
    InventorySourceNotificationTemplatesErrorList,
    InventorySourceNotificationTemplatesStartedList,
    InventorySourceNotificationTemplatesSuccessList,
)

urls = [
    re_path(r'^$', InventorySourceList.as_view(),
            name='inventory_source_list'),
    re_path(r'^(?P<pk>[0-9]+)/$',
            InventorySourceDetail.as_view(),
            name='inventory_source_detail'),
    re_path(r'^(?P<pk>[0-9]+)/update/$',
            InventorySourceUpdateView.as_view(),
            name='inventory_source_update_view'),
    re_path(r'^(?P<pk>[0-9]+)/inventory_updates/$',
            InventorySourceUpdatesList.as_view(),
            name='inventory_source_updates_list'),
    re_path(r'^(?P<pk>[0-9]+)/activity_stream/$',
            InventorySourceActivityStreamList.as_view(),
            name='inventory_source_activity_stream_list'),
    re_path(r'^(?P<pk>[0-9]+)/schedules/$',
            InventorySourceSchedulesList.as_view(),
    InventorySourceList,
    InventorySourceDetail,
    InventorySourceUpdateView,
    InventorySourceUpdatesList,
    InventorySourceActivityStreamList,
    InventorySourceSchedulesList,
    InventorySourceCredentialsList,
    InventorySourceGroupsList,
    InventorySourceHostsList,
    InventorySourceNotificationTemplatesAnyList,
    InventorySourceNotificationTemplatesErrorList,
    InventorySourceNotificationTemplatesSuccessList,
)

urls = [
    url(r'^$', InventorySourceList.as_view(), name='inventory_source_list'),
    url(r'^(?P<pk>[0-9]+)/$',
        InventorySourceDetail.as_view(),
        name='inventory_source_detail'),
    url(r'^(?P<pk>[0-9]+)/update/$',
        InventorySourceUpdateView.as_view(),
        name='inventory_source_update_view'),
    url(r'^(?P<pk>[0-9]+)/inventory_updates/$',
        InventorySourceUpdatesList.as_view(),
        name='inventory_source_updates_list'),
    url(r'^(?P<pk>[0-9]+)/activity_stream/$',
        InventorySourceActivityStreamList.as_view(),
        name='inventory_source_activity_stream_list'),
    url(r'^(?P<pk>[0-9]+)/schedules/$',
        InventorySourceSchedulesList.as_view(),
        name='inventory_source_schedules_list'),