From fa5885a7662840f35ad89c2081639180542842dd Mon Sep 17 00:00:00 2001 From: James Polley Date: Wed, 27 Jun 2018 16:48:26 +1000 Subject: [PATCH] Add a test fixture which creates a user for testing the CFP Also add a single proposal which can be reviewed. --- docker/deploy_with_sqlite.sh | 1 + fixtures/cfp_teams_test.json | 191 +++++++++++++++++++++++++++++++++++ make_dev_container.sh | 6 +- 3 files changed, 196 insertions(+), 2 deletions(-) create mode 100644 fixtures/cfp_teams_test.json diff --git a/docker/deploy_with_sqlite.sh b/docker/deploy_with_sqlite.sh index a17406d4..bbbc3494 100755 --- a/docker/deploy_with_sqlite.sh +++ b/docker/deploy_with_sqlite.sh @@ -9,5 +9,6 @@ if [ -e /configs/auth/auth.json ]; then elif [ $DATABASE_URL == "sqlite:////tmp/symposion.sqlite" ]; then /usr/local/bin/python /app/symposion_app/manage.py loaddata /app/symposion_app/fixtures/admin_users.json fi +/usr/local/bin/python /app/symposion_app/manage.py loaddata -v3 /app/symposion_app/fixtures/cfp_teams_test.json exec /usr/local/bin/uwsgi --http-socket 0.0.0.0:8000 --wsgi-file pinaxcon/wsgi.py diff --git a/fixtures/cfp_teams_test.json b/fixtures/cfp_teams_test.json new file mode 100644 index 00000000..cce657c9 --- /dev/null +++ b/fixtures/cfp_teams_test.json @@ -0,0 +1,191 @@ +[ + { + "model": "auth.user", + "pk": 9001, + "fields": { + "password": "pbkdf2_sha256$36000$XZeHERCW7hl3$eIcr49yuebUb5o5JSwB1AHQc1Tdz+bqw8Tcmy7PxFkA=", + "last_login": null, + "is_superuser": false, + "username": "cfp_speaker", + "first_name": "cfp", + "last_name": "speaker", + "email": "speaker@lca2019.org", + "is_staff": false, + "is_active": true, + "date_joined": "2018-06-27T06:31:21.863Z", + "groups": [], + "user_permissions": [] + } + }, + { + "model": "auth.user", + "pk": 9000, + "fields": { + "password": "pbkdf2_sha256$36000$9EwpJEV9yASD$SZquWdAt+g8k+lseqiVkO304hXKBgtL6uwuPhkF+Wn4=", + "last_login": null, + "is_superuser": false, + "username": "cfp_reviewer", + "first_name": "", + "last_name": "", + "email": "", + "is_staff": false, + "is_active": true, + "date_joined": "2018-06-27T06:31:21.863Z", + "groups": [], + "user_permissions": [] + } + }, + { + "model": "teams.team", + "pk": 1, + "fields": { + "slug": "cfp-review", + "name": "cfp review", + "description": "", + "access": "open", + "created": "2018-06-27T06:41:16.800Z", + "permissions": [ + [ + "can_review_main", + "reviews", + "" + ], + [ + "can_review_miniconf", + "reviews", + "" + ] + ], + "manager_permissions": [ + [ + "can_manage_main", + "reviews", + "" + ], + [ + "can_manage_miniconf", + "reviews", + "" + ], + [ + "can_review_main", + "reviews", + "" + ], + [ + "can_review_miniconf", + "reviews", + "" + ] + ] + } + }, + { + "model": "teams.membership", + "pk": 1, + "fields": { + "user": [ + "cfp_reviewer" + ], + "team": 1, + "state": "member", + "message": "" + } + }, + { + "model": "symposion_speakers.speaker", + "pk": 1, + "fields": { + "user": [ + "cfp_speaker" + ], + "name": "A Speaker of Things", + "biography": "An interesting admin", + "biography_html": "", + "experience": "Lots and lots", + "experience_html": "", + "photo": "", + "telephone": "NONE", + "homepage": "", + "twitter_username": "", + "accessibility": "", + "accessibility_html": "", + "travel_assistance": false, + "accommodation_assistance": false, + "agreement": false, + "annotation": "annotation", + "invite_email": "admin1@example.com", + "invite_token": "token", + "created": "2018-06-27T07:55:35.175Z" + } + }, + { + "model": "symposion_proposals.proposalsection", + "pk": 1, + "fields": { + "section": 1, + "start": "2018-05-30T00:00:00Z", + "end": "2018-07-30T12:00:00Z", + "closed": false, + "published": false + } + }, + { + "model": "symposion_proposals.proposalsection", + "pk": 2, + "fields": { + "section": 2, + "start": "2018-05-30T00:00:00Z", + "end": "2018-07-30T12:00:00Z", + "closed": false, + "published": false + } + }, + { + "model": "symposion_proposals.proposalkind", + "pk": 1, + "fields": { + "section": 1, + "name": "Talk", + "slug": "talk" + } + }, + { + "model": "symposion_proposals.proposalkind", + "pk": 2, + "fields": { + "section": 1, + "name": "Tutorial", + "slug": "tutorial" + } + }, + { + "model": "symposion_proposals.proposalkind", + "pk": 3, + "fields": { + "section": 2, + "name": "Miniconf", + "slug": "miniconf" + } + }, + { + "model": "symposion_proposals.proposalbase", + "pk": 1, + "fields": { + "kind": 1, + "title": "asdfasdf", + "abstract": "asdfasdf", + "abstract_html": "asdfasdf", + "private_abstract": "asdfasdf", + "private_abstract_html": "asdfasdf", + "technical_requirements": "", + "technical_requirements_html": "", + "project": "", + "project_url": "", + "video_url": "", + "submitted": "2018-06-27T06:31:56.956Z", + "speaker": 1, + "cancelled": false + } + } +] diff --git a/make_dev_container.sh b/make_dev_container.sh index 7cc3a74a..f503911a 100755 --- a/make_dev_container.sh +++ b/make_dev_container.sh @@ -22,18 +22,20 @@ docker exec symposion ./manage.py loaddata ./fixtures/{conference,sites,sitetree docker exec symposion ./manage.py create_review_permissions #docker exec symposion ./manage.py populate_inventory #docker exec symposion ./manage.py loaddata ./fixtures/miniconf-fixtures/*.json + if [ -e ./symposion-tools ]; then pushd ./symposion-tools ./fixture_to_docker.sh fixtures/dev_dummy_superuser.json ./fixture_to_docker.sh fixtures/????_*.json popd else - docker exec -it symposion ./manage.py createsuperuser --username root --email root@example.com + docker exec -it symposion ./manage.py createsuperuser --username admin1 --email root@example.com fi +docker exec symposion ./manage.py loaddata -v3 ./fixtures/cfp_teams_test.json set +x echo "Now you can log into http://localhost:28000/admin" -echo "Username: root Password: the one you just typed twice" +echo "Username: admin1 Password: the one you just typed twice" echo "If you need to test as a non-admin user, create one at" echo "http://localhost:28000/admin/auth/user/add/ - then log out" echo "and log back in at http://localhost:28000"