예제 #1
0
def insert_maxuploadsize(apps, schema_editor):
    current = SettingProperties.get_int(constants.MAX_UPLOAD_SIZE, None)
    if current is None and hasattr(settings, 'OPPIA_MAX_UPLOAD_SIZE'):
        settings_prop = SettingProperties()
        settings_prop.key = constants.MAX_UPLOAD_SIZE
        settings_prop.int_value = settings.OPPIA_MAX_UPLOAD_SIZE
        settings_prop.save()
def insert_self_registration(apps, schema_editor):
    current = SettingProperties.get_int(
        constants.OPPIA_ALLOW_SELF_REGISTRATION, None)
    if current is None and hasattr(settings, 'OPPIA_ALLOW_SELF_REGISTRATION'):
        settings_prop = SettingProperties()
        settings_prop.key = constants.OPPIA_ALLOW_SELF_REGISTRATION
        settings_prop.int_value = settings.OPPIA_ALLOW_SELF_REGISTRATION
        settings_prop.save()
예제 #3
0
 def test_self_name_int(self):
     sp = SettingProperties()
     sp.key = u"testintkey"
     sp.int_value = 123
     sp.save()
     self.assertEqual(sp.__unicode__(), u"testintkey")
예제 #4
0
 def test_self_name_string(self):
     sp = SettingProperties()
     sp.key = u"teststrkey"
     sp.str_value = u"test string"
     sp.save()
     self.assertEqual(sp.__unicode__(), u"teststrkey")