'Testing whether settings in the API can be successfully set'

@deferred(timeout=10)
def test_set_settings(self):

    old_filter_setting = self.session.config.get_family_filter_enabled()
    def verify_response(_):
        self.assertNotEqual(self.session.config.get_family_filter_enabled(), old_filter_setting)
    self.should_check_equality = False
    post_data = json.dumps({'general': {'family_filter': (not old_filter_setting)}, 'libtorrent': {'utp': False, 'max_upload_rate': '1234', 'max_download_rate': 50}})
    return self.do_request('settings', expected_code=200, request_type='POST', post_data=post_data, raw_data=True).addCallback(verify_response)
