Skip to content

Commit

Permalink
fix for cache entries not removed (#1621)
Browse files Browse the repository at this point in the history
* fix for cache entries not removed

* updated changelog
  • Loading branch information
matthewhegarty committed Sep 13, 2023
1 parent 15e4267 commit 9820009
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Changelog
- Removed reference to tablib dev from tox build (#1603)
- Add customizable blocks in import.html (#1598)
- Updated ru translation (#1604)
- Fix for cache entries not removed (#1621)
- Fixed badly formatted translation string (#1622)
- Add kwargs to enable CharWidget to return values as strings (#1623)
- Updated documentation for interoperability with third party libraries (#1614)
Expand Down
2 changes: 1 addition & 1 deletion import_export/tmp_storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def read(self):
return cache.get(self.CACHE_PREFIX + self.name)

def remove(self):
cache.delete(self.name)
cache.delete(self.CACHE_PREFIX + self.name)


class MediaStorage(BaseStorage):
Expand Down
4 changes: 2 additions & 2 deletions tests/core/tests/test_tmp_storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ def test_cache_storage(self):
tmp_storage = CacheStorage(name=name)
self.assertEqual(self.test_string, tmp_storage.read())

self.assertNotEqual(cache.get(tmp_storage.CACHE_PREFIX, tmp_storage.name), None)
self.assertIsNotNone(cache.get(tmp_storage.CACHE_PREFIX + tmp_storage.name))
tmp_storage.remove()
self.assertEqual(cache.get(tmp_storage.name), None)
self.assertIsNone(cache.get(tmp_storage.CACHE_PREFIX + tmp_storage.name))

def test_cache_storage_read_with_encoding(self):
tmp_storage = CacheStorage()
Expand Down

0 comments on commit 9820009

Please sign in to comment.