Commits

Hynek Cernoch committed 65ddbfc Draft

Fixed after merge, small typos, enabled south

Comments (0)

Files changed (3)

livesettings/tests.py

 
         self.assertEqual(v, ['set a', 'set d'])
 
-            self.fail("Should be deleted")
+
 class OverrideTest(TestCase):
     """Test settings overrides"""
     def setUp(self):
         # developper with limited permissions
         user2 = User.objects.create_user('cautious_developer', 'fred@example.com', 'secret')
         user2.is_staff = True
-        user2.user_permissions.add(Permission.objects.get(codename='change_setting', \
+        user2.user_permissions.add(Permission.objects.get(codename='change_setting',
                 content_type=ContentType.objects.get(app_label='livesettings', model='setting')))
         user2.save()
         # superuser

livesettings/values.py

             new_value = self.to_python(value)
             if current_value != new_value:
                 if self.update_callback:
-                    new_value = apply(self.update_callback, (current_value, new_value))
+                    new_value = self.update_callback(current_value, new_value)
 
                 db_value = self.get_db_prep_save(new_value)
 
             forms.DecimalField.__init__(self, *args, **kwargs)
 
         def clean(self, value):
-            # Parent "clean" calls "DecimaField.to_python" which converts value to Decimal or None.
+            # Parent "clean" calls "DecimalField.to_python" which converts value to Decimal or None.
             value = super(DecimalValue.field, self).clean(value)
             if value == None:
                 return Decimal("0")
         return v
 
     def get_db_prep_save(self, value):
-        return getattr(value, '__name__', '')  # TODO change to get
+        return getattr(value, '__name__', '')
 
     def to_editor(self, value):
         if value == NOTSET:

test-project/test_project/settings.py

     'django.contrib.flatpages',
     'django.contrib.sitemaps',
     'livesettings',
-    'keyedcache',
     'localsite',
+    'south',
 )
 
 CACHES = {
     'default': {
-        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
-        'TIMEOUT': 5,
+        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
+
         # It is high recommended to configure a global cache for multiprocess
         # servers, because other processes would not be notified about new
         # values with LocMemCache. !!
         #'LOCATION': '127.0.0.1:11211',
         #'TIMEOUT': 300,
         #'KEY_PREFIX': 'T',
+
+        #'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
+        #'TIMEOUT': 5,
     }
 }