RuntimeError: Model doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS

I am writing an app in Django and I'm trying to do some unit testing but I can't seem to find why the test is failing that is the test page:

import re
from django.test import TestCase
from django.urls import reverse
from . import models



class BasicTests(TestCase):

    def test_firstname(self):
        print('test11')
        acc = models.Accounts()
        acc.first_name = 'Moran'
        self.assertTrue(len(acc.id) <= 9, 'Check name is less than 50 digits long')
        self.assertFalse(len(acc.id) > 50, 'Check name is less than 50 digits long')

the error i get is :

RuntimeError: Model class DoggieSitter.accounts.models.Accounts doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS

thats my installed app:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'accounts'
]
Back to Top