I am trying to run a simple django test:
tests.py
from django.test import TestCase
class EasyTest(TestCase):
def test_1(self):
x = 2
y = x * 2
self.assertEqual(y, 4)
settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'db01',
'USER': 'admin',
'PASSWORD': '18101974Oo',
'HOST': 'localhost',
'PORT': 44321,
},
}
But I am getting an error
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
If i use the same code but do import from unittest everything works