0

I am trying to create a tests folder in my django app. My app has following structure:

myapp
myapp/tests/__init__
mtapp/tests/test_email
myapp/function

Now i am trying to import function inside test_email file.

and executing test case as

python manage.py test myapp

but this gives me error No module named function.

Please let me know the reason behind this.

First Edit: if i put "import ..function" then its working fine. but is it a right way to do it.

Note: I am using python version 2.7, Django version 1.5.5

Jayendra Gothi
  • 682
  • 2
  • 11
  • 26

1 Answers1

0

It might be a case of some Cyclic import when you are using from ...filename import function.

It can be resolved by importing the function locally in the TestCase.

Sahil kalra
  • 8,344
  • 4
  • 23
  • 29