Add nested collection management
This commit is contained in:
@@ -337,10 +337,22 @@ class CollectionTests(TestCase):
|
||||
CollectionSection.objects.create(collection=collection, item=note, position=0)
|
||||
manage_url = reverse('collection_manage', args=[collection.id])
|
||||
response = self.client.get(manage_url)
|
||||
self.assertContains(response, 'id="collection-manage"')
|
||||
self.assertContains(response, 'hx-boost="true"')
|
||||
self.assertContains(response, 'hx-swap="outerHTML show:none"')
|
||||
self.assertContains(response, f'{reverse("item_editor", args=[note.id])}?next={manage_url}')
|
||||
self.assertContains(response, '>Section</')
|
||||
self.assertNotContains(response, '>## Section</')
|
||||
|
||||
def test_collection_manage_preserves_search_when_adding_note(self):
|
||||
collection = Collection.objects.create(owner=self.user, title='Reading view')
|
||||
note = Item.objects.create(owner=self.user, kind=Item.Kind.NOTE, content='Findable note')
|
||||
manage_url = reverse('collection_manage', args=[collection.id])
|
||||
|
||||
response = self.client.post(f'{manage_url}?q=Findable', {'action': 'add', 'item_id': note.id})
|
||||
|
||||
self.assertRedirects(response, f'{manage_url}?q=Findable')
|
||||
|
||||
def test_collection_can_include_collection(self):
|
||||
parent = Collection.objects.create(owner=self.user, title='Parent')
|
||||
child = Collection.objects.create(owner=self.user, title='Child')
|
||||
|
||||
Reference in New Issue
Block a user