from unittest.mock import call, patch, PropertyMock, Mock

from directory_cms_client import cms_api_client
import pytest

from django.core.urlresolvers import resolve, reverse

from directory_constants import slugs

from core.tests.helpers import create_response
from industry import constants, views
from industry.views import IndustryDetailCMSView

details_cms_urls = (
    reverse('sector-article', kwargs={'slug': 'article'}),
)
list_cms_urls = (reverse('sector-list'),)
cms_urls = details_cms_urls + list_cms_urls


@pytest.fixture
def contact_page_data(breadcrumbs):
    return {
        'breadcrumbs': breadcrumbs,
        'industry_options': [
            {
                'breadcrumbs_label': 'Agriculture',
                'meta': {'slug': 'agriculture'},
            },
            {
                'breadcrumbs_label': 'Technology',
                'meta': {'slug': 'industry'},
            },
        ],
        'meta': {
            'languages': ['en-gb'],
            'slug': 'industry-contact',
            'url': 'https://www.example.com/industries/contact-us/',
            'pk': 'industry',
        }
    }


@pytest.fixture
def industry_detail_data(breadcrumbs):
    return {
        'search_filter_sector': ['value'],
        'search_filter_text': 'great',
        'search_filter_showcase_only': False,
        'breadcrumbs': breadcrumbs,
        'breadcrumbs_label': 'Technology',
        'meta': {
            'languages': ['en-gb'],
            'slug': 'industry',
            'url': 'https://www.example.com/1/slug/',
            'pk': 'industry',
        }
    }


@pytest.fixture
def industry_list_data(breadcrumbs):
    return {
        'title': 'the page',
        'industries': [
            {'title': 'one', 'show_on_industries_showcase_page': False},