<commit_before>from decimal import Decimal
from django.core import mail
from django.core.urlresolvers import reverse as url
from django.test import TestCase
from django.test.client import Client
from django.utils.encoding import smart_str
from keyedcache import cache_delete
from l10n.models import Country
from l10n.utils import moneyfmt
from product.utils import rebuild_pricing
from satchmo_store.shop.satchmo_settings import get_satchmo_setting
from satchmo_store.shop.tests import get_step1_post_data

domain = 'http://example.com'
prefix = get_satchmo_setting('SHOP_BASE')
if prefix == '/':
    prefix = ''

class ShopTest(TestCase):
    fixtures = ['l10n-data.yaml', 'sample-store-data.yaml', 'products.yaml', 'test-config.yaml', 'initial_data.yaml']

    def setUp(self):
        # Every test needs a client
        cache_delete()
        self.client = Client()
        self.US = Country.objects.get(iso2_code__iexact = "US")
        rebuild_pricing()

    def tearDown(self):<commit_msg>Add a fix to the custom product tests.<commit_after>from decimal import Decimal
from django.core import mail
from django.core.urlresolvers import reverse as url
from django.test import TestCase
from django.test.client import Client
from django.utils.encoding import smart_str
from django.utils.translation import get_language
from django.contrib.sites.models import Site
from keyedcache import cache_delete
from l10n.models import Country
from l10n.utils import moneyfmt
from product.utils import rebuild_pricing
from satchmo_store.shop.satchmo_settings import get_satchmo_setting
from satchmo_store.shop.tests import get_step1_post_data
from django.core.cache import cache

domain = 'http://example.com'
prefix = get_satchmo_setting('SHOP_BASE')
if prefix == '/':
    prefix = ''

class ShopTest(TestCase):
    fixtures = ['l10n-data.yaml', 'sample-store-data.yaml', 'products.yaml', 'test-config.yaml', 'initial_data.yaml']

    def setUp(self):
        # Every test needs a client
        cache_delete()
        self.client = Client()
        self.US = Country.objects.get(iso2_code__iexact = "US")
        current_site = Site.objects.get_current()
        cache_key = "cat-%s-%s" % (current_site.id, get_language())
        cache.delete(cache_key)
        rebuild_pricing()

    def tearDown(self):
{'fraction_non_alphanumeric': 0.09312445604873804, 'fraction_numerical': 0.006962576153176675, 'mean_word_length': 4.297235023041475, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4219849', 'n_tokens_mistral': 703, 'n_tokens_neox': 689, 'n_words': 187}