From eded8c0293b19f5b5f214fca91ba4152d63fce0d Mon Sep 17 00:00:00 2001 From: Theron Luhn Date: Sun, 24 Aug 2025 22:01:27 -0700 Subject: Update tests. --- tests/test_config/pkgs/cachebust/__init__.py | 0 tests/test_config/pkgs/cachebust/override/foo.png | Bin 0 -> 72 bytes tests/test_config/pkgs/cachebust/path/foo.png | Bin 0 -> 72 bytes tests/test_config/test_views.py | 25 ++++++++++++++++------ 4 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 tests/test_config/pkgs/cachebust/__init__.py create mode 100644 tests/test_config/pkgs/cachebust/override/foo.png create mode 100644 tests/test_config/pkgs/cachebust/path/foo.png diff --git a/tests/test_config/pkgs/cachebust/__init__.py b/tests/test_config/pkgs/cachebust/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/test_config/pkgs/cachebust/override/foo.png b/tests/test_config/pkgs/cachebust/override/foo.png new file mode 100644 index 000000000..1cc2f763c Binary files /dev/null and b/tests/test_config/pkgs/cachebust/override/foo.png differ diff --git a/tests/test_config/pkgs/cachebust/path/foo.png b/tests/test_config/pkgs/cachebust/path/foo.png new file mode 100644 index 000000000..43440f881 Binary files /dev/null and b/tests/test_config/pkgs/cachebust/path/foo.png differ diff --git a/tests/test_config/test_views.py b/tests/test_config/test_views.py index 2018e61f2..ce7038b5d 100644 --- a/tests/test_config/test_views.py +++ b/tests/test_config/test_views.py @@ -4065,9 +4065,12 @@ class TestStaticURLInfo(unittest.TestCase): config = testing.setUp() try: request = testing.DummyRequest() - config.add_static_view('static', 'path') + config.add_static_view( + 'static', 'tests.test_config.pkgs.cachebust:path/' + ) config.override_asset( - 'tests.test_config:path/', 'tests.test_config:other_path/' + 'tests.test_config.pkgs.cachebust:path/', + 'tests.test_config.pkgs.cachebust:override/', ) def cb(val): @@ -4077,11 +4080,21 @@ class TestStaticURLInfo(unittest.TestCase): return cb_ - config.add_cache_buster('path', cb('foo')) - result = request.static_url('path/foo.png') + config.add_cache_buster( + 'tests.test_config.pkgs.cachebust:path/', cb('foo') + ) + result = request.static_url( + 'tests.test_config.pkgs.cachebust:path/foo.png' + ) self.assertEqual(result, 'http://example.com/static/foo.png?x=foo') - config.add_cache_buster('other_path', cb('bar'), explicit=True) - result = request.static_url('path/foo.png') + config.add_cache_buster( + 'tests.test_config.pkgs.cachebust:override/', + cb('bar'), + explicit=True, + ) + result = request.static_url( + 'tests.test_config.pkgs.cachebust:path/foo.png' + ) self.assertEqual(result, 'http://example.com/static/foo.png?x=bar') finally: testing.tearDown() -- cgit v1.2.3