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

cache not being cleared when testing #42

Closed
timeyyy opened this issue Jul 1, 2017 · 1 comment
Closed

cache not being cleared when testing #42

timeyyy opened this issue Jul 1, 2017 · 1 comment

Comments

@timeyyy
Copy link
Contributor

timeyyy commented Jul 1, 2017

When testing with django's TestCase, after a test django is successfuly deleting all database entries. However this function is not being called.

@receiver([post_save, post_delete], sender=NotificationType)
def clear_notification_type_cache(*args, **kwargs):
    global _notification_type_cache
    print('CLEARNING NOTIFICATION TYPE CACHE', len(_notification_type_cache))
    _notification_type_cache = {}

Calling this function manually works great to fix my tests, i'm not sure if there is a bug lurking around though...

@timeyyy
Copy link
Contributor Author

timeyyy commented Oct 30, 2017

@timeyyy timeyyy closed this as completed Oct 30, 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

1 participant