Skip to content

Pytest fixture user() is being re-defined #370

@hcho3

Description

@hcho3

Location within the Book

  • Book order number: 11385
  • Book build date (Is the date on page 1): September 16, 2020
  • Book format (PDF, Epub or Mobi): PDF
  • Chapter or Appendix: Chapter
  • Section: 53
  • Subsection: 4
  • What operating system are you using:
    • MacOS Catalina

Hint: Page numbers change all the time. The best way to report an issue is by chapter, section, and subsection numbers.

Description

The section 53.4 instructs the reader to add the following snippet to test_views.py:

@pytest.fixture
def user():
    return UserFactory()

This is redundant because the fixture user() is already defined in conftest.py. The conftest.py is provided by django-crash-starter.

Possible Solutions

Instruct the reader to refer to the fixture user() in conftest.py.

Your full name so we can provide accurate credit within the book

Hyunsu Cho

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions