Commits

Martijn Faassen  committed 969e985

Forgot to commit this much earlier.

  • Participants
  • Parent commits 5c2d68c

Comments (0)

Files changed (3)

 
 - Documentation fix in code samples, thanks to Toby Dacre.
 
+- Fix issue #74, minified .js not served in bottom unless force_bottom,
+  thanks to Toby Dacre.
+
 0.11.4 (2012-01-14)
 ===================
 

File fanstatic/core.py

             if argument is None:
                 continue
             elif isinstance(argument, basestring):
-                mode_resource = Resource(library, argument)
+                mode_resource = Resource(library, argument, bottom=bottom)
             else:
                 # The dependencies of a mode resource should be the same 
                 # or a subset of the dependencies this mode replaces.

File fanstatic/test_core.py

 # XXX add sanity checks: cannot declare something bottom safe while
 # what it depends on isn't bottom safe
 
+def test_html_bottom_safe_used_with_minified():
+    foo = Library('foo', '')
+    a = Resource(foo, 'a.js', minified='a-minified.js', bottom=True)
+    
+    needed = NeededResources(minified=True, bottom=True)
+    needed.need(a)
+
+    top, bottom = needed.render_topbottom()
+    assert top == ''
+    assert bottom == ('<script type="text/javascript" '
+                      'src="/fanstatic/foo/a-minified.js"></script>')
 
 def test_top_bottom_insert():
     foo = Library('foo', '')