@@ -422,3 +422,43 @@ def test_can_get_css_from_many_apps(self):
422
422
423
423
self .assertEqual (expected_content .strip (' ' ),
424
424
actual_content .strip (' ' ))
425
+
426
+ def test_can_get_css_from_many_apps_from_project_and_inline (self ):
427
+ template = u"""{% load compress %}{% compress css %}
428
+ <link rel="stylesheet" href="{{ MEDIA_URL }}css/one.css" type="text/css" charset="utf-8">
429
+ <style type="text/css">p { border:6px solid white;}</style>
430
+ <link rel="stylesheet" href="{{ MEDIA_URL }}css/two.css" type="text/css" charset="utf-8">
431
+ <link rel="stylesheet" href="/media/core/css/test.css" type="text/css" charset="utf-8">
432
+ <link rel="stylesheet" href="/media/otherapp/css/test2.css" type="text/css" charset="utf-8">
433
+ {% endcompress %}
434
+ """
435
+ context = { 'MEDIA_URL' : settings .MEDIA_URL }
436
+ out = u'<link rel="stylesheet" href="/media/CACHE/css/5b3a1d97baec.css" type="text/css" charset="utf-8" />'
437
+ self .assertEqual (out , render (template , context ))
438
+
439
+ expected_content = u"""
440
+ body {
441
+ background:#990;
442
+ }
443
+ p {
444
+ border:6px solid white;
445
+ }
446
+ body {
447
+ color:#fff;
448
+ }
449
+ body {
450
+ margin: 0px;
451
+ }
452
+ body {
453
+ background: red;
454
+ }
455
+ """ .replace ('\n ' , '' ).replace (' ' , '' )
456
+
457
+ storage = get_storage_class (settings .STORAGE )
458
+ file_dir = os .path .dirname (__file__ )
459
+ file_path = os .path .abspath (os .path .join (file_dir , '../media/cache/css/5b3a1d97baec.css' ))
460
+ actual_content = open (file_path , 'r' ).read ().replace ('\n ' , '' ).replace (' ' , '' )
461
+
462
+ import pdb ;pdb .set_trace ()
463
+ self .assertEqual (expected_content .strip (' ' ),
464
+ actual_content .strip (' ' ))
0 commit comments