Unit tests ema
* adds unit tests for ema forms
This commit is contained in:
12
ema/forms.py
12
ema/forms.py
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user