Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override_switch in inherited classes should take precedence #482

Open
oliveryh opened this issue Feb 15, 2023 · 0 comments
Open

override_switch in inherited classes should take precedence #482

oliveryh opened this issue Feb 15, 2023 · 0 comments

Comments

@oliveryh
Copy link

Hello,

We've been using django-waffle quite a lot, and noticed that inherited child classes aren't able to flip the switch state overridden in a given parent class. This behaviour is the case for django's override_settings and was added around 2013, this means that we often assume django-waffle has the same behaviour. The implementation idea below borrows some similar features.

We've done some work in this commit and will briefly summarise the expected behaviour below:

@override_switch('foo', active=False)
class ParentTestClass(TestCase):
    pass

@override_switch('foo', active=True)
class ChildTestCase(ParentTestCase):

    def test_switch_state(self):
        # I expect this to be true
        self.assertTrue(waffle.switch_is_active('foo'))

What are your thoughts on this addition?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant