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 8568423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:06:35+00:00 2026-06-11T18:06:35+00:00

I have the following models : class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField(auto_now_add=True)

  • 0

I have the following models:

class Poll(models.Model):

    question = models.CharField(max_length=200)
    pub_date = models.DateTimeField(auto_now_add=True)

    def __unicode__(self):
             return self.question

and the following test

from polls.models import Poll
from django.test import TestCase
from django.utils import timezone

class PollModelTest(TestCase):

    def test_poll_save(self):
        q = "What is the best OS?"
        pd = timezone.now()
        p = Poll(question=q,
                 pub_date=pd)
        p.save()
        polls = Poll.objects.all()
        self.assertEquals(polls.count(), 1)
        self.assertEquals(polls[0].question, q)

and the following settings:

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
     'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
    'polls',
    'django_nose',

)

TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_ARGS = [
    '--with-coverage',
    '--cover-package=polls',
    '--with-progressive',
    '--verbosity=0',
    '--with-fixture-bundling',
] 

When I try python manage.py test polls the tests run twice. Following is the output:

Creating test database for alias 'default'...
Name           Stmts   Miss  Cover   Missing
--------------------------------------------
polls              0      0   100%   
polls.models       6      0   100%   
--------------------------------------------
TOTAL              6      0   100%   

OK!  2 tests, 0 failures, 0 errors in 0.0s
Destroying test database for alias 'default'...

However when I try without TEST_RUNNER = 'django_nose.NoseTestSuiteRunner', then the tests runs only once. Following is the output:

Creating test database for alias 'default'...
.
----------------------------------------------------------------------
Ran 1 test in 0.002s

OK
Destroying test database for alias 'default'...

Please tell me what is wrong? Why is django-nose running tests twice?

OT: django_nose takes more time than unittest, for the same model.

EDIT:

Here is the folder structure:

├── database.sqlite
├── manage.py
├── mysite
│   ├── __init__.py
│   ├── settings.py
│   ├── templates
│   │   ├── 404.html
│   │   ├── 500.html
│   │   └── base.html
│   ├── urls.py
│   └── wsgi.py
└── polls
    ├── __init__.py
    ├── models.py
    ├── tests
    │   ├── __init__.py
    │   └── test_models.py
    ├── urls.py
    └── views.py
  • 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-11T18:06:37+00:00Added an answer on June 11, 2026 at 6:06 pm

    Probably You have Your tests imported twice. You didn’t show your file structure, but maybe You have this test in separate file and than you do import in tests.py, or something like that.

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

Sidebar

Related Questions

I have following models class Artist(models.Model): name = models.CharField(max_length=200, unique=True) photo = models.CharField(max_length=250) views
I have following models relation: class Section(models.Model): section = models.CharField(max_length=200, unique=True) name = models.CharField(max_length=200,
i have the following models setup class Player(models.Model): #slug = models.slugField(max_length=200) Player_Name = models.CharField(max_length=100)
I have the following models: class Indicator(models.Model): name = models.CharField(max_length=200) category = models.ForeignKey(IndicatorCategory) weight
I have the following two models: class Provider(models.Model): provider = models.CharField(max_length=100, unique=True) class UserProfile(models.Model):
I have the following models: class Territory(models.Model): name = models.CharField(max_length=30) power = models.ForeignKey(Power, null=True,
I have following two models class Questionnaire(models.model) name = models.CharField(max_length=128, null=True, blank=True) type =
I have the following models: class Category(models.Model): name = models.CharField(max_length=200) slug = models.SlugField() parent
I have the following models class Person(models.Model): name = models.CharField(max_length=100) class Employee(Person): job =
I have the following models: class City(models.Model): name = models.CharField(max_length=100) class Pizza(models.Model): name =

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.