Ejemplo n.º 1
0
 def test_serialize_settings(self):
     self.assertSerializedEqual(
         SettingsReference(settings.AUTH_USER_MODEL, "AUTH_USER_MODEL"))
     self.assertSerializedResultEqual(
         SettingsReference("someapp.model", "AUTH_USER_MODEL"),
         ("settings.AUTH_USER_MODEL", {"from django.conf import settings"}),
     )
Ejemplo n.º 2
0
 def deconstruct(self):
     name, path, args, kwargs = super().deconstruct()
     kwargs["to_field"] = SettingsReference(
         getattr(settings, self.setting_name, "id"), self.setting_name)
     if "help_text" in kwargs:
         del kwargs["help_text"]
     return name, path, args, kwargs
Ejemplo n.º 3
0
 def deconstruct(self):
     name, path, args, kwargs = super().deconstruct()
     kwargs["to_field"] = SettingsReference(
         getattr(settings, self.setting_name, "id"), self.setting_name)
     return name, path, args, kwargs