Skip to content

TestCase inheritance breaks with setUpTestData (Django 1.8) #265

@bforchhammer

Description

@bforchhammer

Hi,

We have a large test base with test cases which inherit from each other. I am in the process of converting them to Django 1.8 and tried to use the new setUpTestData class method for setting up test data.

This fails in a very strange way for tests using inheritance: setUpTestData is only invoked for the base class and not for the derived class. I think this may be because of this commit, which changes and overrides setUpClass and tearDownClass in a way which I honestly don't quite understand...

I have created a failing test which shows the problem; the lines which cause errors are annotated with TODO comments.

Any ideas on how to fix or circumvent this problem are greatly appreciated! :-)

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