Skip to content

AppConf ignores @override_settings decorator #29

@syabro

Description

@syabro

I've simple conf.py

class RatesConf(AppConf):
    # Disabling this will be useful for testing purposes
    PREMIUM_AUTO_RECALCULATION_ENABLED = True

and I'm using

from conf import RatesConf

...
@receiver(quote_rates_data_changed)
def on_quote_rates_data_changed(signal, sender, quote, **kwargs):
    if RatesConf.PREMIUM_AUTO_RECALCULATION_ENABLED:
        ...

I set it to False for all tests except when I need to test this place. I'm trying to override it with django's override_settings decorator:

@override_settings(RATES_PREMIUM_AUTO_RECALCULATION_ENABLED=True)
class RatesSignalsTestCase(TestCase):
    def test_quote_rates_data_changed_signal_run_recalculation(self):
        print RatesConf.PREMIUM_AUTO_RECALCULATION_ENABLED 

And I'm getting False

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions