Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#20291 closed New feature (duplicate)

Add method to reload `AppCache`

Reported by: Vlastimil Zíma Owned by: nobody
Component: Testing framework Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Some tests require test application, e.g. proxy_model_inheritance. Adding test application is simple, but removing is not so simple.

I propose addition of new method which would clean caches and repopulate them.

def reload(self):
    # Clean cache
    self._get_models_cache.clear()
    self.handled.clear()
    # Mark cache is empty
    self.loaded = False
    # Populate cache again
    self._populate()

Change History (4)

comment:1 Changed 3 years ago by Jacob

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: duplicate
Status: newclosed

I'm deeply skeptical that this'll actually work. The real answer here is the app-refactor work, which is still ongoing; this is effectively a duplicate of that.

comment:2 Changed 3 years ago by Vlastimil Zíma

Is there a ticket for that? I can't find any relevant one.

comment:3 Changed 3 years ago by Aymeric Augustin

That's #3591.

comment:4 Changed 3 years ago by Vlastimil Zíma

Thanks

Note: See TracTickets for help on using tickets.
Back to Top