Skip to content

Help wanted: add unit tests #5

Open
@vsalvino

Description

@vsalvino

This project is set up nearly identically to our other packages, https://github.com/coderedcorp/wagtail-seo and https://github.com/coderedcorp/wagtail-cache. So the basic unit tests can probably be copied from one of those projects as a starting point.

I have already created a "testproject" which implements all of the functionality.

However, there are no unit tests. The most basic unit test, which would probably get us up to 70% coverage instantly, would be to:

  • Create a single unit test case.
  • This test would create an instance of a page (i.e. MultiStepStreamFormPage in home/models.py)
  • Make a GET request and ensure it responds with a 200

Slightly more advanced tests:

  • Add one of each block type to the page instance
  • Add at least 2 steps to the page instance.
  • GET and POST both steps.
  • Check that a FormSubmission object was created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions