def test_auto_close_us_after_open_task_is_deleted(data):
 data.task1.status = data.task_closed_status
 data.task1.save()
 data.task2.status = data.task_closed_status
 data.task2.save()
 assert (data.user_story1.is_closed is False)
 data.task3.delete()
 data.user_story1 = UserStory.objects.get(pk=data.user_story1.pk)
 assert (data.user_story1.is_closed is True)

def test_auto_close_us_after_open_task_is_deleted ( data ) : data . task1 . status = data . task_closed_status data . task1 . save ( ) data . task2 . status = data . task_closed_status data . task2 . save ( ) assert ( data . user_story1 . is_closed is False ) data . task3 . delete ( ) data . user_story1 = UserStory . objects . get ( pk = data . user_story1 . pk ) assert ( data . user_story1 . is_closed is True )
user story should be in closed state after delete the unique open task .