Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9216291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:23:13+00:00 2026-06-18T02:23:13+00:00

Im trying to write tests for my module. When i run: python manage.py test

  • 0

Im trying to write tests for my module. When i run:

python manage.py test my_module

Im getting message:

django.core.exceptions.ImproperlyConfigured: Please fill out the database NAME in the settings module before using the database.

I dont have any test yet, just BaseTest where im creating users, groups and assigning permissions.

Where could be the problem? Server normally works, configuration seems to be good. Do i need to define settings for test?


Ok. I think i know what was the problem :] I had lists with permissions stored in other module. So i were writting from module.perms import perms (normal python list). Its seems, that python is doing something more than just import that list from other module to my module. And that was the cause of failing.

Solution:
Surround code after list definition with:

if __name__ == "__main__":
   ...

Then everything should be working good.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:23:14+00:00Added an answer on June 18, 2026 at 2:23 am

    Ok. I think i know what was the problem :] I had lists with permissions stored in other module. So i were writting from module.perms import perms (normal python list). Its seems, that python is doing something more than just import that list from other module to my module. And that was the cause of failing.

    Solution: Surround code after list definition with:

    if __name__ == "__main__":
       ...
    

    Then everything should be working good.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run unit tests on my openERP module, but no matter what
I am trying to get the python-connect-mysql module to run, but when I execute
I am trying to write unit tests for a file import export module. One
I'm trying to write a unit test against a single module function. This module
I'm trying to write a unit test for a module that will give me
I'm trying to write some unit tests for my NetBeans module, but i'm unable
I'm trying to write tests for some legacy code with PHPUnit 3.4.9, but it
I am trying to write integration tests. Therefore I need the start methods of
I am trying to write contract tests for some widely used interfaces: Along the
I'm trying to write unit tests in MSTest and I've created two TestClasses. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.