I updated a Django 1.7 project to Django 1.8 and now get errors when I run the tests (that are subclasses of django.test.TestCase
). I will Django 1.7 The project is updated to Django 1.8, Error running test now ( This is a django.test.TestCase
Subclass ).
Traceback (most recent call last): File "env\lib\site-packages\django\test\testcases.py", line 962, in tearDownClasscls._rollback_atomics(cls.cls_atomics) AttributeError: type object 'SomeTests' has no attribute 'cls_atomics'
If I debug through the test I can step through all lines without problems, but after the last line the exception is thrown. If I debug by testing , I can traverse all the rows without any problem , But throw an exception after the last line .
This is an example test: This is an example test :
import djangoimport unittestfrom django.test import TestCaseimport loggingimport sysfrom builtins import classmethod, isinstanceclass ATestTests(TestCase): @classmethod def setUpClass(cls): django.setup() logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) def setUp(self): self._app = Application(name="a") def testtest(self): self.assertIsNotNone(self._app)
My environment: My environment :
astroid==1.3.4colorama==0.3.3defusedxml==0.4.1Django==1.8django-extensions==1.5.2django-filter==0.9.2djangorestframework==3.0.5djangorestframework-xml==1.0.1eight==0.3.0future==0.11.4logilab-common==0.63.2Markdown==2.5.2pylint==1.4.1python-dateutil==2.4.1python-mimeparse==0.1.4six==1.9.0xmltodict==0.9.2
How can I fix this? How can I solve this problem ?