assert '<!--email_off--' in response.content

def test_not_admin(self, rf):
    request = rf.get('/public')
html = '<html><body>content</body>'
response = CloudflareEmailProtect().process_response(request, HttpResponse(
    html))
assert '<!--email_off--' not in response.content

def test_insert_email_off():
    html = 'aa <body zzz>bb cc</body>dd'
result = _insert_email_off(html)
assert result == 'aa <body zzz><!--email_off-->bb cc<!--/email_off--></body>dd'
assert _insert_email_off('aaa') == 'aaa'
Django: [email protected] in admin