Skip to content
Snippets Groups Projects
Unverified Commit b5f46eb1 authored by Luke Murphy's avatar Luke Murphy
Browse files

Add makefile target to reload DB

parent fd4584e7
No related branches found
No related tags found
2 merge requests!199Staging,!179Add makefile target to reload DB
Pipeline #10660 passed
...@@ -3,6 +3,7 @@ MANAGEPY := python manage.py ...@@ -3,6 +3,7 @@ MANAGEPY := python manage.py
PIPENVRUN := pipenv run PIPENVRUN := pipenv run
PROJECT_ROOT := . PROJECT_ROOT := .
SOURCE_DIR := $(PROJECT_ROOT)/$(PROJECT_NAME)/ SOURCE_DIR := $(PROJECT_ROOT)/$(PROJECT_NAME)/
FIXTURES_DIR := $(PROJECT_NAME)/hid/fixtures
lint: lint:
@$(PIPENVRUN) pylava -o setup.cfg $(SOURCE_DIR) @$(PIPENVRUN) pylava -o setup.cfg $(SOURCE_DIR)
...@@ -15,3 +16,10 @@ sort: ...@@ -15,3 +16,10 @@ sort:
test: test:
@$(PIPENVRUN) pytest --cov=$(PROJECT_NAME) @$(PIPENVRUN) pytest --cov=$(PROJECT_NAME)
.PHONY: test .PHONY: test
sudan-db-reset:
$(PIPENVRUN) $(MANAGEPY) reset_db && \
$(PIPENVRUN) $(MANAGEPY) migrate && \
$(PIPENVRUN) $(MANAGEPY) loaddata $(FIXTURES_DIR)/sudan.json && \
$(PIPENVRUN) $(MANAGEPY) loaddata $(FIXTURES_DIR)/taxonomies.json
.PHONY: sudan-db-reset
...@@ -102,5 +102,41 @@ ...@@ -102,5 +102,41 @@
}, },
"model": "data_layer.customconstance", "model": "data_layer.customconstance",
"pk": 1 "pk": 1
},
{
"fields": {
"area_of_specialisation": "",
"business_address": "",
"business_email": "user@example.com",
"business_tel": "",
"contact_type": "",
"country": "",
"date_joined": "2018-10-10T12:17:49.867Z",
"fax": "",
"first_name": "User",
"gender": "",
"groups": [],
"home_address": "",
"home_tel": "",
"is_active": true,
"is_staff": true,
"is_superuser": true,
"job_title": "",
"last_login": "2018-10-18T13:48:12.398Z",
"last_name": "Example",
"mobile": "",
"msn_id": "",
"nationality": "",
"notes": "",
"password": "pbkdf2_sha256$36000$15tPyazbIfk8$NM0Ir7ZnK2ukElrteRhmtBW4Ga6Rn3fePQCw/ZOrYpA=",
"personal_email": "",
"picture": "",
"skype_id": "",
"title": "",
"user_permissions": [],
"yahoo_messenger": ""
},
"model": "users.user",
"pk": 1
} }
] ]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment