'Generalization of the actual test workflow'

def _do_create_preference_test(self, is_active):

    self.client.login(username=self.user.username, password=TEST_PASSWORD)
    if (not is_active):
        self.user.is_active = False
        self.user.save()
    self._set_url('new_key')
    new_value = 'new    value'
    self.send_put(self.client, new_value)
    response = self.send_get(self.client)
    self.assertEqual(new_value, response.data)
