Code

Opened 2 years ago

Closed 17 months ago

Last modified 17 months ago

#17860 closed Bug (invalid)

Documentation for test utils does not take into account create_test_db move

Reported by: danny@… Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords: documentation test create_test_db
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The documentation here - https://docs.djangoproject.com/en/1.3/topics/testing/, at any version, does not take into account the changes made here https://code.djangoproject.com/changeset/8296/django/trunk/django/test/utils.py, which are documented (and hard to find) here - https://code.djangoproject.com/wiki/BackwardsIncompatibleChanges under Refactored the Creation and Introspection modules of the database backends.

Attachments (0)

Change History (7)

comment:1 Changed 2 years ago by ramiro

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

create_test_db and destroy_test_db methods are described at the bottom of such document. They are prefixed by this paragraph:

The creation module of the database backend (connection.creation) also provides some utilities that can be useful during testing.

comment:2 Changed 19 months ago by andymckay

Does cleaning up the docs really require a design decision?

comment:3 Changed 17 months ago by timo

I'm unsure exactly what information this ticket is requesting be added. As far as I can tell, most of the wiki notes describe internal API changes.

comment:4 Changed 17 months ago by ramiro

  • Resolution set to worksforme
  • Status changed from new to closed

comment:5 Changed 17 months ago by danny@…

  • Resolution worksforme deleted
  • Status changed from closed to reopened

The link has moved - but the documentation here - https://docs.djangoproject.com/en/1.3/topics/testing/#django.test.utils.create_test_db - is still not correct. The django.test.utils module in version 3 does NOT have a function create_test_db as shown in the document. The function is elsewhere. If it is an "internal API", then perhaps it should not be described in the test utilities section of that page.

Either way - for 1.3 (and presumably later versions if it has not yet changed) that document is wrong.

comment:6 Changed 17 months ago by kmtracey

  • Resolution set to invalid
  • Status changed from reopened to closed

You seem to be missing the note that exists in this doc about where these methods now exist. Ramiro noted it above, it is directly above the description of the test_db methods:

The creation module of the database backend (connection.creation) also provides some utilities that can be useful during testing.

This paragraph was inserted in the same commit which moved these methods to where they currently are (search for testing.txt on https://github.com/django/django/commit/9dc4ba875f).

I don't see that the doc is incorrect here.

comment:7 Changed 17 months ago by danny@…

Ah - I stand corrected - that prefix does show it is in the other module.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.