Skip to content

Commit e54f9e2

Browse files
author
Gabriel Monroy
committed
fix formation databag after app destroy, with test
1 parent f62a0cb commit e54f9e2

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

api/tasks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def build_app(app):
9191
def destroy_app(app):
9292
CM.purge_app(app.flat())
9393
app.delete()
94+
app.formation.publish()
9495

9596

9697
@task

api/tests/app.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ def test_app_cm(self):
9595
response = self.client.delete(url)
9696
self.assertEqual(response.status_code, 204)
9797
self.assertFalse(os.path.exists(path))
98+
formation_id = 'autotest'
99+
path = os.path.join(settings.TEMPDIR, 'formation-{}'.format(formation_id))
100+
with open(path) as f:
101+
data = json.loads(f.read())
102+
self.assertNotIn(app_id, data['apps'])
98103

99104
def test_app_override_id(self):
100105
body = {'formation': 'autotest', 'id': 'myid'}

0 commit comments

Comments
 (0)