Example #1
0
 def test_remove_tag_from_collection(self):
     c = CollectionFactory()
     r = self.c.get(c.get_absolute_url() + "remove_tag/foo/")
     self.assertEqual(r.status_code, 200)
     r = self.c.get(c.get_absolute_url() + "remove_tag/foo/?ajax=1")
     self.assertEqual(r.status_code, 200)
     self.assertEqual(r.content, "ok")
Example #2
0
 def test_edit_collection(self):
     c = CollectionFactory()
     r = self.c.get(c.get_absolute_url() + "edit/")
     self.assertEqual(r.status_code, 200)
     r = self.c.post(c.get_absolute_url() + "edit/",
                     data=dict(title="updated title"))
     self.assertEqual(r.status_code, 302)
Example #3
0
 def test_collection_toggle_active(self):
     c = CollectionFactory(active=True)
     r = self.c.post(c.get_absolute_url() + "toggle_active/")
     c = Collection.objects.get(id=c.id)
     self.assertEqual(r.status_code, 302)
     self.assertFalse(c.active)
     r = self.c.post(c.get_absolute_url() + "toggle_active/")
     self.assertEqual(r.status_code, 302)
     c = Collection.objects.get(id=c.id)
     self.assertTrue(c.active)
Example #4
0
 def test_edit_collection_workflows(self):
     c = CollectionFactory()
     r = self.c.post(c.get_absolute_url() + "workflows/")
     self.assertEqual(r.status_code, 302)
Example #5
0
 def test_delete_collection(self):
     c = CollectionFactory()
     r = self.c.get(c.get_absolute_url() + "delete/")
     self.assertEqual(r.status_code, 200)
     r = self.c.post(c.get_absolute_url() + "delete/")
     self.assertEqual(r.status_code, 302)