# Path: staticgen/context_processors.py
# def staticgen_publisher(request):
#     context = {}
# 
#     is_publishing = request.META.get('HTTP_X_STATICGEN_PUBLISHER', False)
#     context['STATICGEN_IS_PUBLISHING'] = is_publishing
# 
#     current_site = Site.objects.get_current()
# 
#     base_url = current_site.domain
#     if is_publishing:
#         base_url = get_static_site_domain()
# 
#     context['STATICGEN_BASE_URL'] = base_url
# 
#     return context


from django.conf import settings
from django.test import TestCase
from mock import Mock
from staticgen.context_processors import staticgen_publisher
# -*- coding: utf-8 -*-

from __future__ import unicode_literals





class TestStaticgenContextProcessors(TestCase):

    def test_request_with_custom_header(self):
        request = Mock()
        request.META = {'HTTP_X_STATICGEN_PUBLISHER': True}


# Path: staticgen/context_processors.py
# def staticgen_publisher(request):
#     context = {}
# 
#     is_publishing = request.META.get('HTTP_X_STATICGEN_PUBLISHER', False)
#     context['STATICGEN_IS_PUBLISHING'] = is_publishing
# 
#     current_site = Site.objects.get_current()
# 
#     base_url = current_site.domain
#     if is_publishing:
#         base_url = get_static_site_domain()
# 
#     context['STATICGEN_BASE_URL'] = base_url
# 
#     return context


# Path: tests/test_context_processors.py
from django.conf import settings
from django.test import TestCase
from mock import Mock
from staticgen.context_processors import staticgen_publisher

# -*- coding: utf-8 -*-

from __future__ import unicode_literals





class TestStaticgenContextProcessors(TestCase):

    def test_request_with_custom_header(self):
        request = Mock()
        request.META = {'HTTP_X_STATICGEN_PUBLISHER': True}


        context = staticgen_publisher(request)