Skip to content

override_switch in inherited classes should take precedence #482

Open
@oliveryh

Description

@oliveryh

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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