def test_patch_account_noneditable(self):
        """
        Tests the behavior of patch when a read-only field is attempted to be edited.
        """
        client = self.login_client("client", "user")

        def verify_error_response(field_name, data):
            """
            Internal helper to check the error messages returned
            """
            assert 'This field is not editable via this API' == data['field_errors'][field_name]['developer_message']
            assert "The '{}' field cannot be edited.".format(
                field_name
            ) == data['field_errors'][field_name]['user_message']

        for field_name in ["username", "date_joined", "is_active", "profile_image", "requires_parental_consent"]:
            response = self.send_patch(client, {field_name: "will_error", "gender": "o"}, expected_status=400)
            verify_error_response(field_name, response.data)

        # Make sure that gender did not change.
        response = self.send_get(client)
        assert 'm' == response.data['gender']

        # Test error message with multiple read-only items
        response = self.send_patch(client, {"username": "will_error", "date_joined": "xx"}, expected_status=400)
        assert 2 == len(response.data['field_errors'])
        verify_error_response("username", response.data)
        verify_error_response("date_joined", response.data)