'Test that a client cannot create preferences with bad keys'

def test_create_preference_too_long_key(self):

    self.client.login(username=self.user.username, password=TEST_PASSWORD)
    too_long_preference_key = ('x' * 256)
    new_value = 'new    value'
    self._set_url(too_long_preference_key)
    response = self.send_put(self.client, new_value, expected_status=400)
    self.assertEquals(response.data, {'developer_message': get_expected_validation_developer_message(too_long_preference_key, new_value), 'user_message': get_expected_key_error_user_message(too_long_preference_key, new_value)})
