Questions tagged [model-mommy]

Model-mommy offers a smart way to create fixtures for testing in Django. With a simple API you can create many objects with a single line of code. Instead of building an exhaustive test setup with every possible combination ,it allows you to use objects customized for the current test, while only declaring the test-specific fields.

Model-mommy offers a smart way to create fixtures for testing in Django. With a simple API you can create many objects with a single line of code. Instead of building an exhaustive test setup with every possible combination ,it allows you to use objects customized for the current test, while only declaring the test-specific fields.

18 questions
0
votes
1 answer

model_mommy - user to assignment relationship

I'm finally setting up testing for my Django app, but I'm having difficulties getting started. I'm using model_mommy to create dynamic data for my tests, but have the following problem: The view I'm testing is supposed to show me all the assignments…
LukasKawerau
  • 1,071
  • 2
  • 23
  • 42
0
votes
2 answers

Django: Testing the 'clean' method of a custom ModelForm using Model-Mommy

======= Update ======= @JF brought forward a brilliant perspective for the use of model mommy in ModelForms. With the following code, I managed to automatically generate random data for all the fields of the model, except for the ones I would like…
raratiru
  • 8,748
  • 4
  • 73
  • 113
-1
votes
1 answer

differentiate between custom and 3rd party/inbred apps; django

I am writing tests for model_mommy, very useful fake objects for django. I want a fast way to make the script self-sustaining, and it needs to only write tests for your custom apps in your django project. Right now it may find and write tests for…
codyc4321
  • 9,014
  • 22
  • 92
  • 165
1
2