Fix test for blocking site from results
Previously the logic for testing site blocking was essentially "assert blocked_site not part of result_site". This caused test failures, since site blocking does not extend to subdomains for the blocked site. The reversed logic makes more sense with what the test was trying to accomplish.main
parent
84b5987ac5
commit
119437a07c
|
@ -75,7 +75,7 @@ def test_block_results(client):
|
|||
|
||||
assert has_pinterest
|
||||
|
||||
demo_config['block'] = 'pinterest.com,help.pinterest.com'
|
||||
demo_config['block'] = 'pinterest.com'
|
||||
rv = client.post(f'/{Endpoint.config}', data=demo_config)
|
||||
assert rv._status_code == 302
|
||||
|
||||
|
@ -83,7 +83,10 @@ def test_block_results(client):
|
|||
assert rv._status_code == 200
|
||||
|
||||
for link in BeautifulSoup(rv.data, 'html.parser').find_all('a', href=True):
|
||||
assert 'pinterest.com' not in urlparse(link['href']).netloc
|
||||
result_site = urlparse(link['href']).netloc
|
||||
if not result_site:
|
||||
continue
|
||||
assert result_site not in 'pinterest.com'
|
||||
|
||||
|
||||
def test_recent_results(client):
|
||||
|
|
Loading…
Reference in New Issue