Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document use of the testsite for manual testing #16

Open
PeterJCLaw opened this issue Feb 20, 2023 · 0 comments
Open

Document use of the testsite for manual testing #16

PeterJCLaw opened this issue Feb 20, 2023 · 0 comments

Comments

@PeterJCLaw
Copy link
Collaborator

This appears to be possible and somewhat useful, though a little non-obvious given that it doesn't have migrations already generated.

In case it's useful, the steps I used were (approximately):

createdb testsite # (ask Postgres to create a bootstrap DB for the site)
export TEST_DATABASE_NAME=testsite

tests/testsite/manage.py makemigrations photofeed polls turtles
tests/testsite/manage.py migrate

tests/testsite/manage.py shell --command '
import datetime
from polls.models import Question
Question.objects.create(question_text="Who are you?", pub_date=datetime.datetime.now())
'

tests/testsite/manage.py devdata_export

TEST_DATABASE_NAME=testsite_import tests/testsite/manage.py devdata_import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant