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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:27:00+00:00 2026-05-28T04:27:00+00:00

I am working on a Django project, using the Satchmo shopping cart software. I

  • 0

I am working on a Django project, using the Satchmo shopping cart software. I have to use fairly complex custom code for this project, thus would like to have all Django and Satchmo tests passing.

However, one of the tests only works in isolation, to be precise the custom.ShopTest.test_custom_product in product/modules/custom/tests.py. This test works in isolation (i.e. with ./manage.py test custom.ShopTest) but not when I run all tests together (./manage.py test).

This test opens the home page using the Django test client and asserts if some texts are contained on the page. When I load the same fixture in the production database, these texts are on the page as well.

Also, when the test starts, the product whose title should be shown on the page does also exist in the test database, so the fixture is loaded correctly.

I think some of the other Satchmo apps breaks testing in some way, but I always assumed that Django runs the tests as much as possible in isolation.

EDIT:

The output of the failing test is:

======================================================================
FAIL: test_custom_product (product.modules.custom.tests.ShopTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/Projects/satchmo/satchmo/apps/product/modules/custom/tests.py", line 43, in test_custom_product
    self.assertContains(response, "Computer", count=1)
  File "/data/PythonEnvironments/mywebsite.nl/local/lib/python2.7/site-packages/django/test/testcases.py", line 427, in assertContains
    " (expected %d)" % (real_count, text, count))
AssertionError: Found 0 instances of 'Computer' in response (expected 1)

----------------------------------------------------------------------

EDIT 2:
I just discovered the test does not always happen when I put a breakpoint in the requested view function, and wait a while before continuing when the debugger stops at the breakpoint. Maybe this has something to do with threading?

  • 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-05-28T04:27:01+00:00Added an answer on May 28, 2026 at 4:27 am

    I finally found the solution myself. It had to do something with the caching. Using the dummy cache did solve this specific problem but then another unit test would fail (testCacheGetOK from keyedcache). However, setting the cache timeout to one second during testing solved the problem.

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

Sidebar

Related Questions

I'm working on a Django project, and I've created some custom admin views using
I need some opinions here. I'm working on a Django project using buildout to
I am working on a Silverlight project that uses Django on the server using
I have a django project that I have been working on as a solo
I have a django project, but for some reason basic jquery isn't working. <html>
I have a project that I am working on in django. There are a
I need to have an at-home project now that I'm working on Python/Django at
I'm working on an intranet django project (not using GAE) for a company that
I am working on creating a simple contest submission system using django. This is
I'm working on a project, using Python/Django running on a Virtual Private Server, which

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.