python - Run Django tests PyCharm with coverage -
i'm quite beginner django, testing. since best practice, hope can , running...
i started project (called leden), , made first testfile test_initial.py.
class test_lidviewtests(testcase): def setup(self): self.user = user.objects.create_user(username='jacob', email='jacob@pils.com', password='top_secret') self.client.login(username='jacob', password='top_secret') def test_view_non_existing_lid(self): response = self.client.get(reverse('leden:lid', kwargs={'lid_id': 1})) self.assertequal(response.status_code, 404)
when run tests command python manage.py test, tests run. when try run tests in pycharm (i used this tutorial), following errors:
/home/mathijs/.virtualenvs/ledenbestand/bin/python3.4 /opt/pycharm-3.4/helpers/pycharm/django_test_manage.py test leden.tests /home/mathijs/development/ledenbestand testing started @ 17:00 ... /home/mathijs/.virtualenvs/ledenbestand/lib/python3.4/importlib/_bootstrap.py:321: removedindjango19warning: django.utils.unittest removed in django 1.9. return f(*args, **kwds) /home/mathijs/.virtualenvs/ledenbestand/lib/python3.4/importlib/_bootstrap.py:321: removedindjango19warning: django.utils.unittest removed in django 1.9. return f(*args, **kwds) traceback (most recent call last): file "/opt/pycharm-3.4/helpers/pycharm/django_test_manage.py", line 127, in <module> utility.execute() file "/opt/pycharm-3.4/helpers/pycharm/django_test_manage.py", line 102, in execute pycharmtestcommand().run_from_argv(self.argv) file "/home/mathijs/.virtualenvs/ledenbestand/lib/python3.4/site-packages/django/core/management/commands/test.py", line 30, in run_from_argv super(command, self).run_from_argv(argv) file "/home/mathijs/.virtualenvs/ledenbestand/lib/python3.4/site-packages/django/core/management/base.py", line 390, in run_from_argv self.execute(*args, **cmd_options) file "/home/mathijs/.virtualenvs/ledenbestand/lib/python3.4/site-packages/django/core/management/commands/test.py", line 74, in execute super(command, self).execute(*args, **options) file "/home/mathijs/.virtualenvs/ledenbestand/lib/python3.4/site-packages/django/core/management/base.py", line 441, in execute output = self.handle(*args, **options) file "/opt/pycharm-3.4/helpers/pycharm/django_test_manage.py", line 89, in handle failures = testrunner(test_labels, verbosity=verbosity, interactive=interactive, failfast=failfast) file "/opt/pycharm-3.4/helpers/pycharm/django_test_runner.py", line 228, in run_tests extra_tests=extra_tests, **options) file "/opt/pycharm-3.4/helpers/pycharm/django_test_runner.py", line 128, in run_tests return super(djangoteamcitytestrunner, self).run_tests(test_labels, extra_tests, **kwargs) attributeerror: 'super' object has no attribute 'run_tests'
do guys have idea how can fix this?
it looks there couple of known issues in pycharm v4.0+ cause error message when using django v1.8:
issue 14401 marked fixed in couple of internal builds, it's not clear release version of pycharm fix.
Comments
Post a Comment