# Path: catalog/settings.py
# DATETIME_INPUT_FOMRAT = '%Y-%m-%d %H:%M:%S'
# DATE_INPUT_FOMRAT = '%Y-%m-%d'
# SLUG_FIELD_HELP_TEXT = _(
#     'Can only contain the letters a-z, A-Z, digits, minus and underscores, '
#     'and can\'t start with a digit.')
# UNDERSCORE_FIELD_HELP_TEXT = _(
#     'Can only contain the letters a-z, A-Z, digits and underscores, '
#     'and can\'t start with a digit.')
# ACTIVE_FIELD_HELP_TEXT = _(
#     'Is this object active? You can hide it by unchecking this box.')
# PRODUCT_CHANGE_FORM_TEMPLATE = (
#     'admin/catalog/product_change_form.html')
# ATTRIBUTE_TEMPLATE_CHOICES = getattr(
#     settings, 'CATALOG_ATTRIBUTE_TEMPLATE_CHOICES', (
#         ('radio', _('Radio')),
#     ))
# RELATED_PRODUCT_KIND_CHOICES = getattr(
#     settings, 'CATALOG_RELATED_PRODUCT_KIND_CHOICES', (
#         ('upsell', _('Upsell')),
#         ('cross_sell', _('Cross sell')),
#     ))
# PRODUCTS_PER_PAGE = getattr(settings, 'CATALOG_PRODUCTS_PER_PAGE', 6)
# HAS_CATEGORIES = getattr(settings, 'CATALOG_HAS_CATEGORIES', True)
# HAS_BRANDS = getattr(settings, 'CATALOG_HAS_BRANDS', True)
# HAS_MANUFACTURERS = getattr(settings, 'CATALOG_HAS_MANUFACTURERS', True)
# HAS_MODIFIER_CODES = getattr(settings, 'CATALOG_HAS_MODIFIER_CODES', True)
# PRODUCT_URL = getattr(
#     settings, 'CATALOG_PRODUCT_URL', 'products')
# CATEGORY_URL = getattr(
#     settings, 'CATALOG_CATEGORY_URL', 'categories')
# BRAND_URL = getattr(
#     settings, 'CATALOG_BRAND_URL', 'brands')
# MANUFACTURER_URL = getattr(
#     settings, 'CATALOG_MANUFACTURER_URL', 'manufacturers')
# MEASUREMENT_UNITS = getattr(settings, 'CATALOG_MEASUREMENT_UNITS', [])
# MODIFIER_CONDITIONS = getattr(settings, 'CATALOG_MODIFIER_CONDITIONS', [
#     'catalog.modifier_conditions.PriceGreaterThanModifierCondition',
#     'catalog.modifier_conditions.PriceLessThanModifierCondition',
#     'catalog.modifier_conditions.QuantityGreaterThanModifierCondition',
#     'catalog.modifier_conditions.QuantityLessThanModifierCondition',
#     'catalog.modifier_conditions.WidthGreaterThanModifierCondition',
#     'catalog.modifier_conditions.WidthLessThanModifierCondition',
#     'catalog.modifier_conditions.HeightGreaterThanModifierCondition',
#     'catalog.modifier_conditions.HeightLessThanModifierCondition',
#     'catalog.modifier_conditions.DepthGreaterThanModifierCondition',
#     'catalog.modifier_conditions.DepthLessThanModifierCondition',
#     'catalog.modifier_conditions.WeightGreaterThanModifierCondition',
#     'catalog.modifier_conditions.WeightLessThanModifierCondition',
# ])


from decimal import Decimal as D
from datetime import datetime
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.utils.text import slugify
from shop.models import Cart, CartItem
from catalog.models import *  # noqa
from catalog import settings as scs
        self.assertFalse(self.mod_2.is_eligible_product(self.prod_2))
        self.assertTrue(self.mod_3.is_eligible_product(self.prod_3))
        self.assertFalse(self.mod_4.is_eligible_product(self.prod_4))

    def test_get_cart_modifiers(self):
        mods = Modifier.get_cart_modifiers()
        self.assertEquals(len(mods), 1)
        self.assertEquals(mods[0].kind, 'cart_modifier')


class ModifierModelTestCase(TestCase):
    def setUp(self):
        # User product as a modifier model.
        self.prod = create_product('Prod 1')
        self.prod.modifiers.add(create_modifier('Mod 1'),
                                create_modifier('Mod 2'))

    def test_get_modifiers(self):
        self.assertEquals(len(self.prod.get_modifiers()), 2)


class ModifierConditionTestCase(TestCase):
    def setUp(self):
        self.prod_1 = create_product('Prod 1', 300)
        self.prod_2 = create_product('Prod 2', 10)

        self.mod_1 = create_modifier('Mod 1', [0, -30])
        self.cond_1 = ModifierCondition.objects.create(
            modifier=self.mod_1, path=scs.MODIFIER_CONDITIONS[0], arg=D(200))
        self.cond_2 = ModifierCondition.objects.create(

# Path: catalog/settings.py
# DATETIME_INPUT_FOMRAT = '%Y-%m-%d %H:%M:%S'
# DATE_INPUT_FOMRAT = '%Y-%m-%d'
# SLUG_FIELD_HELP_TEXT = _(
#     'Can only contain the letters a-z, A-Z, digits, minus and underscores, '
#     'and can\'t start with a digit.')
# UNDERSCORE_FIELD_HELP_TEXT = _(
#     'Can only contain the letters a-z, A-Z, digits and underscores, '
#     'and can\'t start with a digit.')
# ACTIVE_FIELD_HELP_TEXT = _(
#     'Is this object active? You can hide it by unchecking this box.')
# PRODUCT_CHANGE_FORM_TEMPLATE = (
#     'admin/catalog/product_change_form.html')
# ATTRIBUTE_TEMPLATE_CHOICES = getattr(
#     settings, 'CATALOG_ATTRIBUTE_TEMPLATE_CHOICES', (
#         ('radio', _('Radio')),
#     ))
# RELATED_PRODUCT_KIND_CHOICES = getattr(
#     settings, 'CATALOG_RELATED_PRODUCT_KIND_CHOICES', (
#         ('upsell', _('Upsell')),
#         ('cross_sell', _('Cross sell')),
#     ))
# PRODUCTS_PER_PAGE = getattr(settings, 'CATALOG_PRODUCTS_PER_PAGE', 6)
# HAS_CATEGORIES = getattr(settings, 'CATALOG_HAS_CATEGORIES', True)
# HAS_BRANDS = getattr(settings, 'CATALOG_HAS_BRANDS', True)
# HAS_MANUFACTURERS = getattr(settings, 'CATALOG_HAS_MANUFACTURERS', True)
# HAS_MODIFIER_CODES = getattr(settings, 'CATALOG_HAS_MODIFIER_CODES', True)
# PRODUCT_URL = getattr(
#     settings, 'CATALOG_PRODUCT_URL', 'products')
# CATEGORY_URL = getattr(
#     settings, 'CATALOG_CATEGORY_URL', 'categories')
# BRAND_URL = getattr(
#     settings, 'CATALOG_BRAND_URL', 'brands')
# MANUFACTURER_URL = getattr(
#     settings, 'CATALOG_MANUFACTURER_URL', 'manufacturers')
# MEASUREMENT_UNITS = getattr(settings, 'CATALOG_MEASUREMENT_UNITS', [])
# MODIFIER_CONDITIONS = getattr(settings, 'CATALOG_MODIFIER_CONDITIONS', [
#     'catalog.modifier_conditions.PriceGreaterThanModifierCondition',
#     'catalog.modifier_conditions.PriceLessThanModifierCondition',
#     'catalog.modifier_conditions.QuantityGreaterThanModifierCondition',
#     'catalog.modifier_conditions.QuantityLessThanModifierCondition',
#     'catalog.modifier_conditions.WidthGreaterThanModifierCondition',
#     'catalog.modifier_conditions.WidthLessThanModifierCondition',
#     'catalog.modifier_conditions.HeightGreaterThanModifierCondition',
#     'catalog.modifier_conditions.HeightLessThanModifierCondition',
#     'catalog.modifier_conditions.DepthGreaterThanModifierCondition',
#     'catalog.modifier_conditions.DepthLessThanModifierCondition',
#     'catalog.modifier_conditions.WeightGreaterThanModifierCondition',
#     'catalog.modifier_conditions.WeightLessThanModifierCondition',
# ])


# Path: tests/catalog/models.py
from decimal import Decimal as D
from datetime import datetime
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.utils.text import slugify
from shop.models import Cart, CartItem
from catalog.models import *  # noqa
from catalog import settings as scs

        self.assertFalse(self.mod_2.is_eligible_product(self.prod_2))
        self.assertTrue(self.mod_3.is_eligible_product(self.prod_3))
        self.assertFalse(self.mod_4.is_eligible_product(self.prod_4))

    def test_get_cart_modifiers(self):
        mods = Modifier.get_cart_modifiers()
        self.assertEquals(len(mods), 1)
        self.assertEquals(mods[0].kind, 'cart_modifier')


class ModifierModelTestCase(TestCase):
    def setUp(self):
        # User product as a modifier model.
        self.prod = create_product('Prod 1')
        self.prod.modifiers.add(create_modifier('Mod 1'),
                                create_modifier('Mod 2'))

    def test_get_modifiers(self):
        self.assertEquals(len(self.prod.get_modifiers()), 2)


class ModifierConditionTestCase(TestCase):
    def setUp(self):
        self.prod_1 = create_product('Prod 1', 300)
        self.prod_2 = create_product('Prod 2', 10)

        self.mod_1 = create_modifier('Mod 1', [0, -30])
        self.cond_1 = ModifierCondition.objects.create(
            modifier=self.mod_1, path=scs.MODIFIER_CONDITIONS[0], arg=D(200))
        self.cond_2 = ModifierCondition.objects.create(

            modifier=self.mod_1, path=scs.MODIFIER_CONDITIONS[0], arg=D(50))