I have a Django project and I'm a little new to it. I have the following PyUnit test trying to save an object in a PostgreSQL database:
import unittest
from foo.models import ObjectType
class DbTest(unittest.TestCase):
def testDBConnection(self):
object_type = ObjectType()
object_type.name = 'Test Object'
object_type.description = 'For testing purposes'
object_type.save()
And my database settings are as follows:
DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'FOO'
DATABASE_USER = 'username'
DATABASE_PASSWORD = 'password'
DATABASE_HOST = 'localhost'
DATABASE_PORT = '5432'
I ran python manage.py syncdb for my project that worked successfully, so my database needs to be configured correctly. However, when trying to run the unit test above:
I get the following error:File "C: \ Python26 \ Lib \ site-packages \ Django \ DB \ engines \ dummy \ base.py", line 15, in the complaint Raise Incorrectly configured: "You have not set DATABASE_ENGINE yet." Incorrect Configured: You have not set the DATABASE_ENGINE installation yet.
- - ? , , ? !