Unit tests ema

* adds unit tests for ema forms
This commit is contained in:
2023-09-05 11:24:29 +02:00
parent 6362fbc387
commit 366c3eec83
2 changed files with 147 additions and 6 deletions

View File

@@ -76,7 +76,7 @@ class NewEmaForm(AbstractCompensationForm, CompensationResponsibleFormMixin, Pik
)
# Finally create main object
acc = Ema.objects.create(
ema = Ema.objects.create(
identifier=identifier,
title=title,
responsible=responsible,
@@ -87,16 +87,16 @@ class NewEmaForm(AbstractCompensationForm, CompensationResponsibleFormMixin, Pik
)
# Add the creating user to the list of shared users
acc.share_with_user(user)
ema.share_with_user(user)
# Add the log entry to the main objects log list
acc.log.add(action)
ema.log.add(action)
# Process the geometry form (NOT ATOMIC TRANSACTION DUE TO CELERY!)
geometry = geom_form.save(action)
acc.geometry = geometry
acc.save()
return acc
ema.geometry = geometry
ema.save()
return ema
class EditEmaForm(NewEmaForm):