@@ -28,15 +28,15 @@ def assert_foo_and_bar_rendered(self, rendered):
2828 r'<div class="foo" style="margin: 10px 15px 20px 25px">'
2929 r'\s+This is the "foo" div.\s+'
3030 r'<\/div>' )
31- self .assertRegexpMatches (
31+ self .assertRegex (
3232 rendered ,
3333 foo_div_regex )
3434
3535 bar_div_regex = (
3636 r'<div class="bar" style="padding: 10px 15px 20px 25px">'
3737 r'\s+This is the "bar" div.\s+'
3838 r'<\/div>' )
39- self .assertRegexpMatches (
39+ self .assertRegex (
4040 rendered ,
4141 bar_div_regex )
4242
@@ -120,10 +120,10 @@ def test_unicode_context_variables(self):
120120
121121 rendered = template .render ({
122122 'unicode_string' : u'I love playing with my pi\xf1 ata' })
123- self .assertRegexpMatches (
123+ self .assertRegex (
124124 rendered ,
125125 '<div class="bar" style="padding: 10px 15px 20px 25px">' )
126- self .assertRegexpMatches (
126+ self .assertRegex (
127127 rendered ,
128128 u'I love playing with my pi\xf1 ata' )
129129
@@ -139,37 +139,37 @@ def test_comments_are_ignored(self):
139139 template = get_template ('comments_are_ignored.html' )
140140
141141 rendered = template .render ({})
142- self .assertRegexpMatches (
142+ self .assertRegex (
143143 rendered ,
144144 r'<body>\s+<!-- Here is comment one -->\s+<div' )
145- self .assertRegexpMatches (
145+ self .assertRegex (
146146 rendered ,
147147 r'This is the "foo" div.\s+<!-- comment two -->\s+' )
148- self .assertRegexpMatches (
148+ self .assertRegex (
149149 rendered ,
150150 r'This is the "bar" div.\s+<!-- comment three -->\s+' )
151151
152152
153- class DebugModeStaticfilesTests (TestCase ):
154- @override_settings (DEBUG = True )
155- @patch ('django.contrib.staticfiles.finders.find' )
156- def test_debug_mode_uses_staticfiles_finder (self , find ):
153+ class GetLoaderStaticfilesTests (TestCase ):
154+ @patch ('django.contrib.staticfiles.storage.staticfiles_storage.path' )
155+ def test_default_uses_staticfiles_storage (self , path ):
157156 full_path = os .path .join (
158157 settings .STATIC_ROOT ,
159158 'foobar.css' ,
160159 )
161- find .return_value = full_path
160+ path .return_value = full_path
162161 template = get_template ('single_staticfiles_css.html' )
163162 template .render ({})
164- find .assert_called_once_with ("foobar.css" )
163+ path .assert_called_once_with ("foobar.css" )
165164
166- @patch ('django.contrib.staticfiles.storage.staticfiles_storage.path' )
167- def test_non_debug_mode_uses_staticfiles_storage (self , path ):
165+ @override_settings (INLINECSS_CSS_LOADER = 'django_inlinecss.css_loaders.StaticfilesFinderCSSLoader' )
166+ @patch ('django.contrib.staticfiles.finders.find' )
167+ def test_override_uses_staticfiles_finder (self , find ):
168168 full_path = os .path .join (
169169 settings .STATIC_ROOT ,
170170 'foobar.css' ,
171171 )
172- path .return_value = full_path
172+ find .return_value = full_path
173173 template = get_template ('single_staticfiles_css.html' )
174174 template .render ({})
175- path .assert_called_once_with ("foobar.css" )
175+ find .assert_called_once_with ("foobar.css" )
0 commit comments