Permalink
Browse files

* removed unused imports

* added more unit tests
  • Loading branch information...
1 parent baffe75 commit 52796f289c31366338978f146de0a89f18a55ecc @kux kux committed Dec 28, 2012
Showing with 26 additions and 4 deletions.
  1. +0 −2 filertags/signals.py
  2. +26 −2 filertags/tests.py
View
@@ -1,7 +1,5 @@
import codecs
import hashlib
-import os
-import os.path
import re
import urlparse
View
@@ -7,8 +7,7 @@
from filer.models.filemodels import File
from filer.models.foldermodels import Folder
-from filer.tests.helpers import (create_superuser, create_folder_structure,
- create_image, create_clipboard_item)
+from filer.tests.helpers import create_superuser
from filertags.signals import _ALREADY_PARSED_MARKER, _LOGICAL_URL_TEMPLATE
@@ -103,3 +102,28 @@ def test_unquoted_url(self):
""")
self._verify_css_is_corectly_rewritten(css)
+ def test_commented_url(self):
+ original_content = """\
+.pledge-block {
+/* background: url( ../images/foobar.png ); */
+}
+"""
+ css = self.create_file('relative_url_to_image.css', self.producer_css,
+ content=original_content)
+ css_content = open(css.path).read()
+ # css remains unchanged since the url statement is within a comment
+ expected_content = '%s\n%s' % (_ALREADY_PARSED_MARKER, original_content)
+ self.assertEqual(expected_content, css_content)
+
+ def test_non_http_schema(self):
+ original_content = """\
+.pledge-block {
+ background: url(data:image/png;base64,iVBORw0KGgoAA);
+}
+"""
+ css = self.create_file('relative_url_to_image.css', self.producer_css,
+ content=original_content)
+ css_content = open(css.path).read()
+ expected_content = '%s\n%s' % (_ALREADY_PARSED_MARKER, original_content)
+ self.assertEqual(expected_content, css_content)
+

0 comments on commit 52796f2

Please sign in to comment.