Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix #5405 - Added missing tests for admindocs #760

wants to merge 4 commits into


None yet
4 participants

@elvard wrote a code for fixing #5405 and i added missing tests to apply the pull request: #484


wgx731 commented Jun 21, 2013

+1, I think this feature should be included, now my model docstrings looks bad on admin doc page.


@timgraham timgraham commented on the diff Sep 18, 2013

+ Display an individual :model:`myapp.MyModel`.
+ **Context**
+ ``RequestContext``
+ ``mymodel``
+ An instance of :model:`myapp.MyModel`.
+ **Template:**
+ :template:`myapp/my_template.html` (DESCRIPTION)
+ """
+ @classmethod

timgraham Sep 18, 2013


use unittest.skipIf decorator on the class

@timgraham timgraham commented on the diff Sep 18, 2013

@@ -267,8 +275,10 @@ def model_detail(request, app_label, model_name):
return render_to_response('admin_doc/model_detail.html', {
'root_path': urlresolvers.reverse('admin:index'),
'name': '%s.%s' % (opts.app_label, opts.object_name),
- 'summary': _("Fields on %s objects") % opts.object_name,
- 'description': model.__doc__,
+ 'heading': _("Fields on %s objects") % opts.object_name,

timgraham Sep 18, 2013


for backwards compatibility, It would be good not to rename context variables


timgraham commented Sep 18, 2013

This no longer merges cleanly. Please open a new pull request if you can update it, thanks!

@timgraham timgraham closed this Sep 18, 2013

@zanderle zanderle added a commit to zanderle/django that referenced this pull request Nov 3, 2014

@zanderle zanderle Fixed #5405 -- Added support for reStructured text in admindocs for m…
…odel docstrings

Referred to PR #760 for help
@elvard wrote code to support it, but it needed to be modified, in order to merge
@gkmngrgn added tests that also needed to be modified

Squashed commits:
[39a9318] Made changes asked in review by MarkusH

- Renamed TestDocstrings to more apt name TestUtils
- Wrote tests for methods in utils
- Removed unused meta data for ModelDetailView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment