def test_patch_invalid_email(self, bad_email):
        """
        Test a few error cases for email validation (full test coverage lives with do_email_change_request).
        """
        client = self.login_client("client", "user")

        # Try changing to an invalid email to make sure error messages are appropriately returned.
        error_response = self.send_patch(client, {"email": bad_email}, expected_status=400)
        field_errors = error_response.data["field_errors"]
        assert "Error thrown from validate_new_email: 'Valid e-mail address required.'" == \
               field_errors['email']['developer_message']
        assert 'Valid e-mail address required.' == field_errors['email']['user_message']