Changes between Initial Version and Version 1 of Ticket #23612


Ignore:
Timestamp:
Oct 7, 2014, 10:05:32 AM (10 years ago)
Author:
Simon Charette
Comment:

First I assume the files in products/fixtures/ are named <name>.json and not products/fixtures/<name>.json.

I don't have Windows VM at hand but isn't it using backslashes (\) as directory separators?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23612 – Description

    initial v1  
    33Example Test Case:
    44
    5     # cart/tests.py
     5{{{#!python
     6# cart/tests.py
    67
    7     class CartTestBase(TestCase):
    8         fixtures = ['products/fixtures/product_categories.json',
    9         'products/fixtures/brands.json', 'products/fixtures/products.json']
     8class CartTestBase(TestCase):
     9    fixtures = ['products/fixtures/product_categories.json',
     10    'products/fixtures/brands.json', 'products/fixtures/products.json']
     11}}}
    1012
    1113Which 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{{{
     15ecomm_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}}}
    2831
    2932The specific error message is:
    3033
    31     UserWarning: No fixture named 'products/fixtures/products' found.
    32     warnings.warn("No fixture named '%s' found." % fixture_name)
     34{{{
     35UserWarning: No fixture named 'products/fixtures/products' found.
     36warnings.warn("No fixture named '%s' found." % fixture_name)
     37}}}
    3338
    3439The 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`
Back to Top