'Verify DeleteFormset ignores DELETE field and uses form method'

def test_custom_delete(self):

    self.test_init_database()
    data = dict(self.data)
    data['form-INITIAL_FORMS'] = 4
    data.update({('form-%d-id' % i): user.pk for (i, user) in enumerate(User.objects.all())})
    data.update(self.delete_all_ids)
    formset = self.DeleteFormset(data, queryset=User.objects.all())
    self.assertTrue(formset.is_valid())
    self.assertEqual(len(formset.save()), 0)
    self.assertEqual(len(User.objects.all()), 2)
    odd_ids = [user.pk for user in User.objects.all() if (user.pk % 2)]
    self.assertEqual(len(odd_ids), 0)
