'Internal helper to generalize the creation of a set of preferences'

def _do_create_preferences_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.send_patch(self.client, {'dict_pref': {'int_key': 10}, 'string_pref': 'value'}, expected_status=204)
    response = self.send_get(self.client)
    self.assertEqual({u'dict_pref': u"{u'int_key':    10}", u'string_pref': u'value'}, response.data)
