-
Notifications
You must be signed in to change notification settings - Fork 32
Conversation
Bear in mind that django puts tests in corresponding app folders. On Sunday, 6 October 2013, Mihai Bivol wrote:
Alex |
It's a blogpost in #71. I used those ideas. Also the current tests tested an unused method. |
|
||
## How to add tests | ||
|
||
Anytime you solve a bug or introduce a new feature you need to add a new test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For bugs there is a need of a regression test first - http://en.wikipedia.org/wiki/Regression_testing.
I would go for the next flow:
- I found a bug
- I write a regression test to reproduce the bug
- I fix the bug and the regression test is failing
- I fix the test
Also, tests for bugs should contain a reference to the bug's issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can use factories for models? What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do that in this branch?
cc @mihaibivol Review please |
It doesn't really make sense. |
@icemanftg It may be a little defensive, but I think it's a good way to understand the behaviour and the code before you write a fix. If you think it's overhead then we will drop it. |
LGTM. @icemanftg I left it with the following flow:
It should be clear that if the test is poorly written you will reiterate and rewrite it :) |
Create module for app testing
What I mean is that I do not see a point for writing a test that fails before and after the bug fixed. And to be honest I don't really see how you can do that. |
It's updated anyways. The whole idea is if you have a bug, you solve it and add a test. (If something may break write a test) In this instance something is already broken :) |
Parent issue #71
Need
In order to easily add tests when implementing a feature or solving a bug As a developer I want to know where to add new tests
Deliverables
Solution