Test coverage report: permission.tests.test_app.models

# permission.tests.test_app.models: 11 total statements, 100.0% covered

Generated: Thu 2012-03-01 08:22 CST

Source file: /home/alisue/Dropbox/Codes/django-permission/permission/tests/test_app/models.py

Stats: 6 executed, 0 missed, 5 excluded, 33 ignored

1. `# vim: set fileencoding=utf-8 :`
2. `"""`
3. `An extra models for using unittest`
4. ``
5. ``
6. `AUTHOR:`
7. `lambdalisue[Ali su ae] (lambdalisue@hashnote.net)`
8. ``
9. `License:`
10. `The MIT License (MIT)`
11. ``
12. `Copyright (c) 2012 Alisue allright reserved.`
13. ``
14. `Permission is hereby granted, free of charge, to any person obtaining a copy`
15. `of this software and associated documentation files (the "Software"), to`
16. `deal in the Software without restriction, including without limitation the`
17. `rights to use, copy, modify, merge, publish, distribute, sublicense, and/or`
18. `sell copies of the Software, and to permit persons to whom the Software is`
19. `furnished to do so, subject to the following conditions:`
20. ``
21. `The above copyright notice and this permission notice shall be included in`
22. `all copies or substantial portions of the Software.`
23. ``
24. `THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR`
25. `IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,`
26. `FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE`
27. `AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER`
28. `LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING`
29. `FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS`
30. `IN THE SOFTWARE.`
31. ``
32. `"""`
33. `from __future__ import with_statement`
34. `from django.db import models`
35. `from django.contrib.auth.models import User`
36. ``
37. `class Article(models.Model):`
38. `title = models.CharField('title', max_length=200, default='No title')`
39. `body = models.TextField('body', blank=True, default='')`
40. `author = models.ForeignKey(User, verbose_name='user', related_name='articles')`
41. `created_at = models.DateTimeField('created_at', auto_now_add=True)`
42. ``
43. `def __unicode__(self):`
44. `return self.title`