Changes between Initial Version and Version 1 of Ticket #23612
- Timestamp:
- Oct 7, 2014, 10:05:32 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23612 – Description
initial v1 3 3 Example Test Case: 4 4 5 # cart/tests.py 5 {{{#!python 6 # cart/tests.py 6 7 7 class CartTestBase(TestCase): 8 fixtures = ['products/fixtures/product_categories.json', 9 'products/fixtures/brands.json', 'products/fixtures/products.json'] 8 class CartTestBase(TestCase): 9 fixtures = ['products/fixtures/product_categories.json', 10 'products/fixtures/brands.json', 'products/fixtures/products.json'] 11 }}} 10 12 11 13 Which fits into a directory structure of: 12 13 ecomm_app/ 14 cart/ 15 __init__.py 16 models.py 17 tests.py 18 . . . 19 20 products/ 21 fixtures/ 22 products/fixtures/product_categories.json 23 products/fixtures/brands.json 24 products/fixtures/products.json 25 __init__.py 26 models.py 27 . . . 14 {{{ 15 ecomm_app/ 16 cart/ 17 __init__.py 18 models.py 19 tests.py 20 . . . 21 22 products/ 23 fixtures/ 24 products/fixtures/product_categories.json 25 products/fixtures/brands.json 26 products/fixtures/products.json 27 __init__.py 28 models.py 29 . . . 30 }}} 28 31 29 32 The specific error message is: 30 33 31 UserWarning: No fixture named 'products/fixtures/products' found. 32 warnings.warn("No fixture named '%s' found." % fixture_name) 34 {{{ 35 UserWarning: No fixture named 'products/fixtures/products' found. 36 warnings.warn("No fixture named '%s' found." % fixture_name) 37 }}} 33 38 34 39 The corresponding app modules are listed in `INSTALLED_APPS` and work fine otherwise. Specifying an absolute path does work, but obviously isn't cross-platform. Specifying a root-relative path does not work, e.g.: `/products/fixtures/brands.json`