Skip to content

Commit 33fb5ea

Browse files
committed
OBS-385: fix tests
1 parent d283a30 commit 33fb5ea

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

webapp/crashstats/crashstats/finders.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@ def find(self, path, all=False):
2020
# staticfiles finders. Before we raise an error, try to find out where,
2121
# in the bundles, this was defined. This will make it easier to correct
2222
# the mistake.
23-
for config_name in "STYLESHEETS", "JAVASCRIPT":
24-
config = settings.PIPELINE[config_name]
25-
for key, directive in config.items():
26-
if path in directive["source_filenames"]:
27-
raise ImproperlyConfigured(
28-
"Static file {} can not be found anywhere. Defined in "
29-
"PIPELINE[{!r}][{!r}]['source_filenames']".format(
30-
path, config_name, key
31-
)
23+
config = settings.PIPELINE["JAVASCRIPT"]
24+
for key, directive in config.items():
25+
if path in directive["source_filenames"]:
26+
raise ImproperlyConfigured(
27+
"Static file {} can not be found anywhere. Defined in "
28+
"PIPELINE[{!r}][{!r}]['source_filenames']".format(
29+
path, "JAVASCRIPT", key
3230
)
31+
)
3332
# If the file can't be found AND it's not in bundles, there's
3433
# got to be something else really wrong.
3534
raise NotImplementedError(path)

webapp/crashstats/crashstats/tests/test_finders.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ def test_missing_css_source_file(self, settings):
1717
busted_pipeline = copy.deepcopy(settings.PIPELINE)
1818
# Doesn't matter which key we chose to bust, so let's just
1919
# pick the first one.
20-
key = list(busted_pipeline["STYLESHEETS"].keys())[0]
21-
filenames = busted_pipeline["STYLESHEETS"][key]["source_filenames"]
20+
key = list(busted_pipeline["JAVASCRIPT"].keys())[0]
21+
filenames = busted_pipeline["JAVASCRIPT"][key]["source_filenames"]
2222

2323
# add a junk one
24-
filenames += ("neverheardof.css",)
25-
busted_pipeline["STYLESHEETS"][key]["source_filenames"] = filenames
24+
filenames += ("neverheardof.js",)
25+
busted_pipeline["JAVASCRIPT"][key]["source_filenames"] = filenames
2626

2727
settings.PIPELINE = busted_pipeline
2828

0 commit comments

Comments
 (0)