Question

I have an integrationTest case written in django webFrameWork using Tastypie.

test_file.py

  from django.utils import unittest

  @unittest.skip('skipping')
  def test_admission(self):
  self.check_entity('admission',admission,'Not validate ')

Command to run integration Test Case on terminal:

(/home/arya/trunk/integrationtests) arya-$ nosetests  -v  test_file.py

On importing django.utils to skip this integrationTest case, Following error is throwing on terminal :

ERROR OUPUT :

Failure: ImportError (No module named django.utils) ... ERROR

======================================================================
ERROR: Failure: ImportError (No module named django.utils)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/arya/trunk/integrationtests/test_file.py", line 1, in <module>
    from django.utils import unittest
ImportError: No module named django.utils

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)

Is there any fault in settings or some other reason?

Was it helpful?

Solution

Try to use

import unittest

instead of

from django.utils import unittest
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top