'Make sure that an add form that is filled out, but marked for deletion
doesn\'t cause validation errors.'

def test_add_form_deletion_when_invalid(self):

    PoetFormSet = modelformset_factory(Poet, can_delete=True)
    data = {'form-TOTAL_FORMS': u'1', 'form-INITIAL_FORMS': u'0', 'form-MAX_NUM_FORMS': u'0', 'form-0-id': u'', 'form-0-name': (u'x' * 1000)}
    formset = PoetFormSet(data, queryset=Poet.objects.all())
    self.assertEqual(formset.is_valid(), False)
    self.assertEqual(Poet.objects.count(), 0)
    data['form-0-DELETE'] = 'on'
    formset = PoetFormSet(data, queryset=Poet.objects.all())
    self.assertEqual(formset.is_valid(), True)
    formset.save()
    self.assertEqual(Poet.objects.count(), 0)
