Skip to content
This repository has been archived by the owner on Sep 18, 2022. It is now read-only.

Clean up test project #56

Closed
pydanny opened this issue Mar 7, 2011 · 13 comments
Closed

Clean up test project #56

pydanny opened this issue Mar 7, 2011 · 13 comments
Labels

Comments

@pydanny
Copy link
Owner

pydanny commented Mar 7, 2011

View libraries are ugly. Thoughts:

  • Convert to 1.2.x style generic views everywhere possible
  • Add django-coverage so we can see actual coverage of the library in unittests
@maraujop
Copy link
Collaborator

maraujop commented Mar 7, 2011

I have added my fork's test runner to the 0.8.0-test branch. IMHO it its better to have the app testing independent of a test project that it is not included when installing the app.

This testing suite speeds up testing the application and it is turning in the de facto way of testing a Django apps nowadays.

Coverage reports:

helpers      168     87    48%
util        6      6     0%
templatetags/uni_form_field      14     14     0%
templatetags/uni_form_tags      109    109     0%

I will work on raising the numbers. On the other hand, I believe it would be better to update the README and docs, than working on improving the test project.

How about moving docs to readTheDocs?

@maraujop
Copy link
Collaborator

Just saw you are actually planning on moving docs to readTheDocs!! I completely missed the new README, sounds good.

@pydanny
Copy link
Owner Author

pydanny commented Mar 10, 2011

Docs have been at maraujop, just not up to date. ;)

@maraujop
Copy link
Collaborator

I don't follow the sentence, must be my English, sorry.

@pydanny
Copy link
Owner Author

pydanny commented Mar 10, 2011

Not your English. My English. ;)

Oops. Docs have been at http://readthedocs.org/projects/dango-uni-form/ for some time.

@maraujop
Copy link
Collaborator

damn! I didn't have a clue, I couldn't feel more stupid now :)

@pydanny
Copy link
Owner Author

pydanny commented Mar 10, 2011

Dude. It was my mistake. Not yours!

@maraujop
Copy link
Collaborator

hahaha ! no problem :D

@maraujop
Copy link
Collaborator

Ok Danny,

We have a subtle problem, coverage reports false numbers, because it doesn't count the statements executed by the template rendering itself, which is pretty much the bulk of the code. So I think I will move tests to a more manual way, manually calling some of the rendering functions instead, to have real statistics. This way we will be able to improve real testing coverage.

What do you think?

@pydanny
Copy link
Owner Author

pydanny commented Mar 12, 2011

Excellent point and it sounds like a great idea!

@maraujop
Copy link
Collaborator

Today I've discovered I was wrong. coverage is reporting the right numbers, the only problem is I was misusing it. I was all the time checking percentages in the wrong file, instead of checking uni_form_tags I was checking helpers. So forget everything I have said and the numbers posted before.

Today I refactored some tests changing them to generate UniFormNodes and passing manually made Tokens. It took me some time to realize I wasn't doing anything wrong, it's just me!

Anyways, now I'm ready for raising the current numbers, which are higher than in the master branch:

Name                             Stmts   Miss  Cover
----------------------------------------------------
../helpers                         197    111    44%
../templatetags/uni_form_field      14      3    79%
../templatetags/uni_form_tags      115     30    74%
../util                              6      0   100%
----------------------------------------------------
TOTAL                              332    144    57%

Sorry for the confusion :)

@venkasub
Copy link

I see when you install, test_project is also getting installed. Is it fine?

@maraujop
Copy link
Collaborator

test_project has been dropped in version 0.8.1 so I'm happily closing this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants