# Unit test konova app

* adds unit test for konova app models
* drops unused/unnecessary code fragments
* updates translation
This commit is contained in:
2023-09-08 12:47:50 +02:00
parent 42cb138276
commit e443c5f8be
11 changed files with 255 additions and 85 deletions

View File

@@ -22,7 +22,7 @@ from konova.forms.modals import RemoveModalForm
from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP
from konova.sub_settings.context_settings import TAB_TITLE_IDENTIFIER
from konova.utils.message_templates import DATA_CHECKED_PREVIOUSLY_TEMPLATE, RECORDED_BLOCKS_EDIT, \
CHECKED_RECORDED_RESET, FORM_INVALID, IDENTIFIER_REPLACED, DO_NOT_FORGET_TO_SHARE, GEOMETRY_SIMPLIFIED
CHECK_STATE_RESET, FORM_INVALID, IDENTIFIER_REPLACED, DO_NOT_FORGET_TO_SHARE, GEOMETRY_SIMPLIFIED
from konova.utils.user_checks import in_group
@@ -230,12 +230,11 @@ def edit_view(request: HttpRequest, id: str):
if data_form.is_valid() and geom_form.is_valid():
# The data form takes the geom form for processing, as well as the performing user
# Save the current state of recorded|checked to inform the user in case of a status reset due to editing
i_rec = intervention.recorded is not None
i_check = intervention.checked is not None
intervention_is_checked = intervention.checked is not None
intervention = data_form.save(request.user, geom_form)
messages.success(request, _("Intervention {} edited").format(intervention.identifier))
if i_check or i_rec:
messages.info(request, CHECKED_RECORDED_RESET)
if intervention_is_checked:
messages.info(request, CHECK_STATE_RESET)
if geom_form.geometry_simplified:
messages.info(
request,