@ensure_empty_collections("users", "teams")
    @clear_collections("users", "teams")
    def test_create_user_request_email_validation(self):

        team = base_team.copy()
        api.team.create_team(team)

        invalid_email_user = base_user.copy()
        invalid_email_user["email"] = "not_an_email"

        with pytest.raises(Exception):
            api.user.create_user_request(invalid_email_user)
            assert False, "Was able to register a user with something that doesn't look like an email."

        invalid_email_user["email"] = "hax$@test.c"

        with pytest.raises(WebException):
            api.user.create_user_request(invalid_email_user)
            assert False, "Was able to register a user with invalid characters"

        valid_email_user = base_user.copy()
        assert api.user.create_user_request(valid_email_user), "Was not able to register a valid email."
Returns True if the key is in the cache and has not expired.
dataset/ETHPy150Open EasyCTF/easyctf-2015/api/tests/user_test.py/TestUsers.test_create_user_request_email_validation--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/core/cache/backends/base.py/BaseCache.has_key