You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

utils_tests.py 525B

1234567891011121314151617
  1. from django.test import TestCase
  2. from django.test.utils import override_settings
  3. from oscar.core import utils
  4. class TestSlugify(TestCase):
  5. def test_uses_custom_mappings(self):
  6. mapping = {'c++': 'cpp'}
  7. with override_settings(OSCAR_SLUG_MAP=mapping):
  8. self.assertEqual('cpp', utils.slugify('c++'))
  9. def test_uses_blacklist(self):
  10. blacklist = ['the']
  11. with override_settings(OSCAR_SLUG_BLACKLIST=blacklist):
  12. self.assertEqual('bible', utils.slugify('The Bible'))