def test_anonymise_view_submit__redirect_to_anonymise_view(self):
    obj_1 = ModelWithPrivacyMetaFactory.create(anonymised=False)
    obj_2 = ModelWithPrivacyMetaFactory.create(anonymised=False)
    response = self.client.post((model_root_url + 'anonymise/'), {'ids': ','.join([str(obj_1.pk), str(obj_2.pk)])}, follow=True)
    obj_1.refresh_from_db()
    obj_2.refresh_from_db()
    self.assertTrue(obj_1.anonymised)
    self.assertTrue(obj_2.anonymised)
    if (django.VERSION <= (1, 9)):
        self.assertEqual(len(response.redirect_chain), 1)
        self.assertTrue(response.redirect_chain[0][0].endswith(model_root_url))
        self.assertEqual(response.redirect_chain[0][1], 302)
    else:
        self.assertEqual(response.redirect_chain, [(model_root_url, 302)])
    self.assertContains(response, '<li class="success">2 Model With Privacy Metas anonymised</li>')
def test_anonymise_view_submit__redirect_to_anonymise_view(self):
    obj_1 = ModelWithPrivacyMetaFactory.create(anonymised=False)
    obj_2 = ModelWithPrivacyMetaFactory.create(anonymised=False)
    response = self.client.post((model_root_url + 'anonymise/'), {'ids': ','.join([str(obj_1.pk), str(obj_2.pk)])}, follow=True)
    obj_1.refresh_from_db()
    obj_2.refresh_from_db()
    self.assertTrue(obj_1.anonymised)
    self.assertTrue(obj_2.anonymised)
    if (django.VERSION <= (1, 9)):
        self.assertEqual(len(response.redirect_chain), 1)
        self.assertTrue(response.redirect_chain[0][0].endswith(model_root_url))
        self.assertEqual(response.redirect_chain[0][1], 302)
    else:
        self.assertEqual(response.redirect_chain, [(model_root_url, 302)])
    self.assertContains(response, '<li class="success">2 Model With Privacy Metas anonymised</li>')