diff options
| author | Theron Luhn <theron@luhn.com> | 2025-08-24 22:01:27 -0700 |
|---|---|---|
| committer | Theron Luhn <theron@luhn.com> | 2025-08-24 22:01:27 -0700 |
| commit | eded8c0293b19f5b5f214fca91ba4152d63fce0d (patch) | |
| tree | 186056586a7ef49d7fec94a7f3fefcc8d3755553 | |
| parent | ed315c142c7f66f6ee9ff24f4bad6997b0b45bfb (diff) | |
| download | pyramid-eded8c0293b19f5b5f214fca91ba4152d63fce0d.tar.gz pyramid-eded8c0293b19f5b5f214fca91ba4152d63fce0d.tar.bz2 pyramid-eded8c0293b19f5b5f214fca91ba4152d63fce0d.zip | |
Update tests.
| -rw-r--r-- | tests/test_config/pkgs/cachebust/__init__.py | 0 | ||||
| -rw-r--r-- | tests/test_config/pkgs/cachebust/override/foo.png | bin | 0 -> 72 bytes | |||
| -rw-r--r-- | tests/test_config/pkgs/cachebust/path/foo.png | bin | 0 -> 72 bytes | |||
| -rw-r--r-- | tests/test_config/test_views.py | 25 |
4 files changed, 19 insertions, 6 deletions
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 --- /dev/null +++ b/tests/test_config/pkgs/cachebust/__init__.py diff --git a/tests/test_config/pkgs/cachebust/override/foo.png b/tests/test_config/pkgs/cachebust/override/foo.png Binary files differnew file mode 100644 index 000000000..1cc2f763c --- /dev/null +++ b/tests/test_config/pkgs/cachebust/override/foo.png diff --git a/tests/test_config/pkgs/cachebust/path/foo.png b/tests/test_config/pkgs/cachebust/path/foo.png Binary files differnew file mode 100644 index 000000000..43440f881 --- /dev/null +++ b/tests/test_config/pkgs/cachebust/path/foo.png 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() |
