# Path: dju_common/settings.py
# LOG_DIR = getattr(settings, 'LOG_DIR', os.path.join(settings.BASE_DIR, 'logs').replace('\\', '/'))
# USE_HTTPS = getattr(settings, 'USE_HTTPS', False)
# DJU_EMAIL_RETURN_PATH = getattr(settings, 'DJU_EMAIL_RETURN_PATH', None)
# DJU_EMAIL_REPLY_TO = getattr(settings, 'DJU_EMAIL_REPLY_TO', None)  # list of emails
# DJU_EMAIL_DOMAIN_BLACK_LIST = getattr(settings, 'DJU_EMAIL_DOMAIN_BLACK_LIST', (
#     'mailinator.com', '10minutemail.com', 'spambog.com', 'tempinbox.com', 'mailmetrash.com',
#     'tempemail.net', 'yopmail.com', 'sharklasers.com', 'guerrillamailblock.com', 'guerrillamail.com',
#     'guerrillamail.net', 'guerrillamail.biz', 'guerrillamail.org', 'guerrillamail.de', 'spam4.me', 'spam.su',
#     'inboxed.im', 'inboxed.pw', 'gomail.in', 'tokem.co', 'nomail.pw', 'yanet.me', 'powered.name', 'shut.ws',
#     'vipmail.pw', 'powered.im', 'linuxmail.so', 'secmail.pw', 'shut.name', 'freemail.ms', 'mailforspam.com',
#     'uroid.com', 'rmqkr.net',
# ))
# DJU_EMAIL_DEFAULT_CONTEXT = getattr(settings, 'DJU_EMAIL_DEFAULT_CONTEXT',
#                                     'dju_common.context_processors.email_default')
# DJU_EMAIL_DEBUG_IN_CONSOLE = getattr(settings, 'DJU_EMAIL_DEBUG_IN_CONSOLE', True)
# DJU_EMAIL_DEBUG_IN_FILES = getattr(settings, 'DJU_EMAIL_DEBUG_IN_FILES', True)
# DJU_EMAIL_DEBUG_PATH = getattr(settings, 'DJU_EMAIL_DEBUG_PATH',
#                                os.path.join(LOG_DIR, 'debug_email').replace('\\', '/'))
# DJU_GRAVATAR_DEFAULT_SIZE = getattr(settings, 'DJU_GRAVATAR_DEFAULT_SIZE', 50)
# DJU_GRAVATAR_DEFAULT_IMAGE = getattr(settings, 'DJU_GRAVATAR_DEFAULT_IMAGE', 'mm')
# DJU_GRAVATAR_RATING = getattr(settings, 'DJU_GRAVATAR_RATING', 'g')  # g, pg, r, x
# DJU_GRAVATAR_SECURE = getattr(settings, 'DJU_GRAVATAR_SECURE', USE_HTTPS)


    from html import unescape  # python 3.4+
    from HTMLParser import HTMLParser  # python 2.x
from django.contrib.sites.models import Site
from django.core.paginator import Paginator
from django.http import QueryDict
from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase
from django.utils.html import escape
from dju_common import settings as dju_settings

        t = self.get_tpl_f("{% url_getvars_with '&b,c&' %}", {'request': self.R('a=1&b=2&b=3&c=4')})
        self.assertTrue(unescape(t()).startswith('&') and unescape(t()).endswith('&'))

        t = self.get_tpl_f("{% url_getvars_with '' %}", {'request': self.R('a=1&b=2&b=3')})
        self.assertEqual(t(), '')

    def test_url_getvars_without(self):
        t = self.get_tpl_f("{% url_getvars_without 'a,c' %}", {'request': self.R('a=1&b=2&b=3&c=4')})
        self.assertEqual(QueryDict(unescape(t())), QueryDict('b=2&b=3'))

        t = self.get_tpl_f("{% url_getvars_without '' %}", {'request': self.R('a=1&b=2&b=3&c=4')})
        self.assertEqual(QueryDict(unescape(t())), QueryDict('a=1&b=2&b=3&c=4'))

    def test_full_url_prefix(self):
        r = '{scheme}://' + Site.objects.get_current().domain

        t = self.get_tpl_f('{% full_url_prefix %}')
        self.assertEqual(t(), r.format(scheme=(dju_settings.USE_HTTPS and 'https' or 'http')))

        t = self.get_tpl_f('{% full_url_prefix 0 %}')
        self.assertEqual(t(), r.format(scheme='http'))

        t = self.get_tpl_f('{% full_url_prefix 1 %}')
        self.assertEqual(t(), r.format(scheme='https'))

    def test_add_full_url_prefix(self):
        r = '{scheme}://' + Site.objects.get_current().domain

        t = self.get_tpl_f('{{ var|add_full_url_prefix }}', {'var': '/test.html'})

# Path: dju_common/settings.py
# LOG_DIR = getattr(settings, 'LOG_DIR', os.path.join(settings.BASE_DIR, 'logs').replace('\\', '/'))
# USE_HTTPS = getattr(settings, 'USE_HTTPS', False)
# DJU_EMAIL_RETURN_PATH = getattr(settings, 'DJU_EMAIL_RETURN_PATH', None)
# DJU_EMAIL_REPLY_TO = getattr(settings, 'DJU_EMAIL_REPLY_TO', None)  # list of emails
# DJU_EMAIL_DOMAIN_BLACK_LIST = getattr(settings, 'DJU_EMAIL_DOMAIN_BLACK_LIST', (
#     'mailinator.com', '10minutemail.com', 'spambog.com', 'tempinbox.com', 'mailmetrash.com',
#     'tempemail.net', 'yopmail.com', 'sharklasers.com', 'guerrillamailblock.com', 'guerrillamail.com',
#     'guerrillamail.net', 'guerrillamail.biz', 'guerrillamail.org', 'guerrillamail.de', 'spam4.me', 'spam.su',
#     'inboxed.im', 'inboxed.pw', 'gomail.in', 'tokem.co', 'nomail.pw', 'yanet.me', 'powered.name', 'shut.ws',
#     'vipmail.pw', 'powered.im', 'linuxmail.so', 'secmail.pw', 'shut.name', 'freemail.ms', 'mailforspam.com',
#     'uroid.com', 'rmqkr.net',
# ))
# DJU_EMAIL_DEFAULT_CONTEXT = getattr(settings, 'DJU_EMAIL_DEFAULT_CONTEXT',
#                                     'dju_common.context_processors.email_default')
# DJU_EMAIL_DEBUG_IN_CONSOLE = getattr(settings, 'DJU_EMAIL_DEBUG_IN_CONSOLE', True)
# DJU_EMAIL_DEBUG_IN_FILES = getattr(settings, 'DJU_EMAIL_DEBUG_IN_FILES', True)
# DJU_EMAIL_DEBUG_PATH = getattr(settings, 'DJU_EMAIL_DEBUG_PATH',
#                                os.path.join(LOG_DIR, 'debug_email').replace('\\', '/'))
# DJU_GRAVATAR_DEFAULT_SIZE = getattr(settings, 'DJU_GRAVATAR_DEFAULT_SIZE', 50)
# DJU_GRAVATAR_DEFAULT_IMAGE = getattr(settings, 'DJU_GRAVATAR_DEFAULT_IMAGE', 'mm')
# DJU_GRAVATAR_RATING = getattr(settings, 'DJU_GRAVATAR_RATING', 'g')  # g, pg, r, x
# DJU_GRAVATAR_SECURE = getattr(settings, 'DJU_GRAVATAR_SECURE', USE_HTTPS)


# Path: tests/tests/test_templatetags_common.py
    from html import unescape  # python 3.4+
    from HTMLParser import HTMLParser  # python 2.x
from django.contrib.sites.models import Site
from django.core.paginator import Paginator
from django.http import QueryDict
from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase
from django.utils.html import escape
from dju_common import settings as dju_settings


        t = self.get_tpl_f("{% url_getvars_with '&b,c&' %}", {'request': self.R('a=1&b=2&b=3&c=4')})
        self.assertTrue(unescape(t()).startswith('&') and unescape(t()).endswith('&'))

        t = self.get_tpl_f("{% url_getvars_with '' %}", {'request': self.R('a=1&b=2&b=3')})
        self.assertEqual(t(), '')

    def test_url_getvars_without(self):
        t = self.get_tpl_f("{% url_getvars_without 'a,c' %}", {'request': self.R('a=1&b=2&b=3&c=4')})
        self.assertEqual(QueryDict(unescape(t())), QueryDict('b=2&b=3'))

        t = self.get_tpl_f("{% url_getvars_without '' %}", {'request': self.R('a=1&b=2&b=3&c=4')})
        self.assertEqual(QueryDict(unescape(t())), QueryDict('a=1&b=2&b=3&c=4'))

    def test_full_url_prefix(self):
        r = '{scheme}://' + Site.objects.get_current().domain

        t = self.get_tpl_f('{% full_url_prefix %}')
        self.assertEqual(t(), r.format(scheme=(dju_settings.USE_HTTPS and 'https' or 'http')))

        t = self.get_tpl_f('{% full_url_prefix 0 %}')
        self.assertEqual(t(), r.format(scheme='http'))

        t = self.get_tpl_f('{% full_url_prefix 1 %}')
        self.assertEqual(t(), r.format(scheme='https'))

    def test_add_full_url_prefix(self):
        r = '{scheme}://' + Site.objects.get_current().domain

        t = self.get_tpl_f('{{ var|add_full_url_prefix }}', {'var': '/test.html'})

        self.assertEqual(t(), r.format(scheme=(dju_settings.USE_HTTPS and 'https' or 'http')) + '/test.html')