Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove warning for a directory entry using a CDN #576

Merged
merged 1 commit into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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