Skip to content

Is it possible to use Django's test client with Reactivated? #366

Answered by crgwbr
bartacc asked this question in Q&A
Discussion options

You must be logged in to vote

We generally use the built-in Django testing tools rather than pytest. We have a few different kinds of tests:

  1. Some e2e testing happens with Django's LiveServerTestCase + a Playwrite headless browser.
  2. Other testing uses the normal TestCase class and the Django Test Client.

So, @bartacc, your approach should work. But, you do need to build the reactivated assets first. We accomplish that by means of a Makefile that looks something like this:

.PHONY: types
types:
	npm exec tsc --noEmit && \
	python manage.py generate_client_assets

.PHONY: build
build: types
	python manage.py build

.PHONY: test
test: build
	python manage.py test

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@silviogutierrez
Comment options

@crgwbr
Comment options

Answer selected by silviogutierrez
@bartacc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants