Merge pull request #62 from Nebucatnetzer/dev

Dev
This commit is contained in:
Andreas Zweili 2022-02-08 15:10:33 +01:00 committed by GitHub
commit 20df60069a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 6 deletions

View File

@ -4,9 +4,12 @@ SHELL=/usr/bin/env bash
.PHONY: run
run: setup
( \
source venv/bin/activate; \
export DJANGO_SETTINGS_MODULE=network_inventory.settings.local; \
$(find . -name __pycache__ -o -name "*.pyc" -delete) \
find . -name __pycache__ -o -name "*.pyc" -delete; \
python manage.py runserver; \
)
.PHONY: setup
setup: ./venv
@ -65,15 +68,24 @@ cleanall: clean
.PHONY: init
init:
( \
source venv/bin/activate; \
export DJANGO_SETTINGS_MODULE=network_inventory.settings.local; \
python manage.py loaddata network_inventory.yaml
python manage.py loaddata network_inventory.yaml; \
)
.PHONY: test
test:
( \
source venv/bin/activate; \
export DJANGO_SETTINGS_MODULE=network_inventory.settings.local; \
pytest -nauto --nomigrations --cov=. --cov-report=html
pytest -nauto --nomigrations --cov=. --cov-report=html; \
)
.PHONY: debug
debug:
( \
source venv/bin/activate; \
export DJANGO_SETTINGS_MODULE=network_inventory.settings.local; \
pytest --pdb --nomigrations --cov=. --cov-report=html
pytest --pdb --nomigrations --cov=. --cov-report=html; \
)

View File

@ -43,9 +43,10 @@ def test_device_update_view(create_admin_user):
'model': '',
'location': '',
'user': '',
'installation_date': ''}
'installation_date': '',
'save_device': ""}
response = client.post('/update/device/{}/'.format(device.pk), data)
assert response.status_code == 200
assert response.status_code == 302
device.refresh_from_db()
assert device.name == data['name']