Skip to content

Commit

Permalink
Merge pull request #576 from freedomofpress/remove-cdn-warning
Browse files Browse the repository at this point in the history
Remove warning for a directory entry using a CDN
  • Loading branch information
harrislapiroff authored Dec 21, 2018
2 parents f0af91c + cbcc28f commit fc48574
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
5 changes: 3 additions & 2 deletions directory/tests/test_models_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ def test_instance_with_analytics_gets_severe_warning(self):
result = ScanResultFactory(no_failures=True, no_analytics=False)
self.assertEqual(self.securedrop.get_warnings(result)[0].level, WarningLevel.SEVERE)

def test_instance_with_cdn_gets_severe_warning(self):
def test_instance_with_cdn_gets_no_warning(self):
result = ScanResultFactory(no_failures=True, no_cdn=False)
self.assertEqual(self.securedrop.get_warnings(result)[0].level, WarningLevel.SEVERE)

self.assertEqual(self.securedrop.get_warnings(result), [])

def test_instance_with_cross_domain_assets_gets_severe_warning(self):
result = ScanResultFactory(no_failures=True, no_cross_domain_assets=False)
Expand Down
14 changes: 0 additions & 14 deletions directory/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ def subdomain_test(scan_result):
return TestResult.PASS


def cdn_test(scan_result):
if scan_result.no_cdn:
return TestResult.PASS
else:
return TestResult.FAIL


def third_party_asset_test(scan_result):
if scan_result.no_analytics and scan_result.no_cross_domain_assets:
return TestResult.PASS
Expand All @@ -60,13 +53,6 @@ def third_party_asset_test(scan_result):


WARNINGS = [
Warning(
'no_cdn',
cdn_test,
WarningLevel.SEVERE,
'{} uses a CDN.'
),

Warning(
'no_third_party_assets',
third_party_asset_test,
Expand Down

0 comments on commit fc48574

Please sign in to comment.