There is problem with import of module from parent directory as __main__ lies in child folder
if you do the folder structure like below your same code for import will work
+----test
+---test_models.py
+---__init__.py
+---address_book
+---__init__.py
+---models.py
or you can add your project path to PYTHONPATH variable and your same code will work