Currently when a key is setted via the config form within a migration, the override_djconfig will not work in some cases (ie: self.client.get(...)). This is because if the middleware is called, it will reload the config since there is something in the confg table, thus overriding all settings. To avoid this, override_djconfig should call reload_maybe and then override the desire settings.
Also, if someone is doing this, it's likely s/he will want to call reload_maybe wihin the setUp method or the migration itself, so it should be described in the docs as a tip.
form.save already calls reload_maybe so no need for calling it manually. Since the tests has to run the migrations before the test is called, override_djconfig will work properly.
The migration should deppend on the djconfig initial migration.
Currently when a key is setted via the config form within a migration, theoverride_djconfig
will not work in some cases (ie:self.client.get(...)
). This is because if the middleware is called, it will reload the config since there is something in the confg table, thus overriding all settings. To avoid this,override_djconfig
should callreload_maybe
and then override the desire settings.Also, if someone is doing this, it's likely s/he will want to callreload_maybe
wihin thesetUp
method or the migration itself, so it should be described in the docs as a tip.form.save
already callsreload_maybe
so no need for calling it manually. Since the tests has to run the migrations before the test is called,override_djconfig
will work properly.The migration should deppend on the djconfig initial migration.