Skip to content

Fixtures silently do nothing when --simple is specified, and no documentation calls this out #114

@LucidDan

Description

@LucidDan

While learning to use behave and behave-django, having come from a pytest background, I had very little pre-existing knowledge of Django's testcase implementations. One thing that tripped me up was that it was my fixtures were not being loaded - I was using --simple because I don't need or want the liveserver, but it was not immediately obvious why things were failing, until I did some digging in the code and the Django documentation.

I wouldn't call this a bug, but I think it isn't great for something to silently fail, or if that's a reasonable outcome it should definitely be documented, even if only briefly.

Some possible solutions I can see:

  1. Improve documentation with a "Note" box in the fixtures section and/or in the --simple section, explaining that SimpleTestCase doesn't support some functionality like loading fixtures.
  2. Add warnings (or errors? probably not, I guess) when using --simple and fixtures in combination, warning that fixtures won't have any effect and may cause unexpected behaviour.

Let me know what you think, happy to do a PR for one or the other of these. I have some other thoughts on the issue of testcase type being used, but will put that in a separate ticket as I think it is a totally separate issue from the documentation and silent failure of fixtures.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions