#13717: What to do next?

2 views
Skip to first unread message

Silvio

unread,
Oct 22, 2010, 12:21:02 PM10/22/10
to Django developers
Hey guys,

I opened ticket #13717, and it seems to be reproducible by other
people. Someone contributed a patch, but the ticket is "stuck" because
it needs tests.

I would really like to see this fixed by 1.3, so I'd be more than
happy to write these and submit them. But I'm not sure in which file
the tests belong. I'd appreciate any pointers.

Thanks,

Silvio

Jacob Kaplan-Moss

unread,
Oct 22, 2010, 12:27:50 PM10/22/10
to django-d...@googlegroups.com

Yeah, sorry about that -- the test suite organization is a bit of a
mess. The general idea when you're adding new tests is that you'd
ideally like to group 'em with other tests of the same functionality.
In the (increasingly rare) case that the feature you want to test
isn't covered yet you can make a new test app for it.

What I usually do when I'm looking for the correct place to add tests
is to grep [1] over the existing test suite looking for existing code
that already covers the same place. If I search for "unique_for" in
the existing test suite, I find that string in the following files:

tests/modeltests/model_forms/models.py
tests/modeltests/model_forms/tests.py
tests/modeltests/model_formsets/models.py
tests/modeltests/validation/models.py
tests/modeltests/validation/test_unique.py

That last file, "test_unique.py" seems like a good candiate, and if I
crack it open I see test functions like
test_unique_for_date_exclusion() and
test_unique_for_date_gets_picked_up(), so seems like that'd be a
pretty good place for the tests for #13717/

Thanks for helping out!

Jacob

[1] Ack, actually: http://betterthangrep.com/

Reply all
Reply to author
Forward
0 new messages