This commit is contained in:
lwark
2025-09-17 07:52:16 -05:00
commit a2ff72dda8
584 changed files with 52247 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import os
import tempfile
from wiki.models import URLPath
from wiki.plugins.attachments import models
from tests.core.test_commands import TestManagementCommands
class TestAttachmentManagementCommands(TestManagementCommands):
"""
Add some more data
"""
def setUp(self):
super().setUp()
self.test_file = tempfile.NamedTemporaryFile(
"w", delete=False, suffix=".txt"
)
self.test_file.write("test")
self.child1 = URLPath.create_urlpath(
self.root, "test-slug", title="Test 1"
)
self.attachment1 = models.Attachment.objects.create(
article=self.child1.article
)
self.attachment1_revision1 = models.AttachmentRevision.objects.create(
attachment=self.attachment1,
file=self.test_file.name,
)
def tearDown(self):
os.unlink(self.test_file.name)
super().tearDown()