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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:15:16+00:00 2026-06-06T07:15:16+00:00

When using test fixtures in Django is the convention to include the foreign models

  • 0

When using test fixtures in Django is the convention to include the foreign models inside of the test fixture i.e.

class NewsletterTest(TestCase):
    fixtures = ('newsletters.json')
    # Test stuff

Vs. loading associated models in order:

class NewsletterTest(TestCase):
    fixtures = ('events.json','newsletters.json')
    # Test stuff

It seems like the pros of including it in the same testfixture file is that if I need to change my fixture data for a test in another spot, I might break a test somewhere else relying on that data. On the other hand if I update my model, I may need to update my test fixture, which would mean updating it in every location it’s used. How is this usually handled?

  • 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-06T07:15:18+00:00Added an answer on June 6, 2026 at 7:15 am

    I ended up including everything. The testfixture should have everything it needs to load properly, who wants to manage multiple levels of testfixture dependencies, down there lies madness!

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

Sidebar

Related Questions

How do you load test fixtures using the django-nose test runner?
I have a PHPUnit test that's using a Doctrine2 custom repository and Doctrine Fixtures.
Using Nunit, I want to be able to write a test fixture that will
I can load the fixture file in my django application by using loaddata: manage.py
I'm trying to test my Rails App with test fixtures using Watir. The watir
Using ActiveSupport::TestCase. I think that's the old Test::Unit. I have several tables that represent
I am using Test to test my application. I have some fixtures: users.yml, roles.yml,
I'm using fixtures to hold all the test data that I have. Each row
I've got a functional test that's using fixtures. I also am using fixtures in
I'm using Test::Unit with shoulda to test a controller. Since I'm just testing the

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.