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_flag doesn't affect template? #228

Closed
wasabigeek opened this issue Oct 18, 2016 · 4 comments
Closed

override_flag doesn't affect template? #228

wasabigeek opened this issue Oct 18, 2016 · 4 comments

Comments

@wasabigeek
Copy link

Hoping someone can shed light on this - with the following code:

Django Test

with override_flag('showNewCalc', active=True):
    response = self.client.get("/correct-url/")
    self.assertContains(response, 'href="{0}"'.format(correct_url))

HTML

<a href="{% flag 'showNewCalc' %}/correct-url/{% else %}{% url 'app.views.incorrect_url' %}{% endflag %}">
     LINK
</a>

The test sees the incorrect_url. Is that expected i.e. I can only use the override_flag with a view?

@jsocol
Copy link
Collaborator

jsocol commented Jan 16, 2017

No, I would definitely expect /correct-url/ in this case. Have you had any luck with this? Do you think you could write a test case (or a patch)?

@aarcro
Copy link

aarcro commented Jun 5, 2017

I've hit an issue with override_flag just in my test cases. I think the issue is that it doesn't flush the cache. So even though I'm doing @override_flag('flag', active=False) in pdb I can check waffle.models.Flag.get(name='flag').everyone and it is False as expected. When I step into waffle.flag_is_active I see that it pulls the Flag from cache and everyone == True

@aarcro
Copy link

aarcro commented Jun 5, 2017

Just checked out the code to make a PR for this, but maybe this was addressed? Master for version 12 looks like it's in a better shape than 11.1 that is out currently. Any chance of getting a release out soon?

@jsocol
Copy link
Collaborator

jsocol commented Aug 26, 2017

0.12 was released a few weeks after this—going to go ahead and close it but please re-open if it's still an issue!

@jsocol jsocol closed this as completed Aug 26, 2017
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

3 participants