#175 More unit-tests
Merged by . Opened by pingou.
more_tests  into  master

Download 175.patch
no initial comment

shouldn't the file use "pagure" instead of "progit"?
Otherwise, :thumbsup:

It should yes, but I need to fix them all, so I'll do a separate PR for this and fix them all once and for all :)

Thanks for the review :)

AFAIK, it's a good practice to write granular test cases. You should have a single test class to test a functionality, and multiple test methods to check various use cases (branches) of the functionality. A test method should usually comprise of a single action and one or many assertions.

@carljm's talk on Django testing was an eye opener for me.
http://pycon-2012-notes.readthedocs.org/en/latest/testing_and_django.html

Above is a lot of code for the test case. Why don't we move it to setUp?

@pingou test!

@rtnpro you are right that it could be moved out of this method, but at the moment this logic is not re-used anywhere else.

If it were, I would probably not move it to setUp() but more likely to its own function like in: https://pagure.io/pagure/blob/master/f/tests/test_progit_flask_ui_fork.py#_57

Metadata