Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dms/models/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Storage(models.Model):
root_directory_ids = fields.One2many(
comodel_name="dms.directory",
inverse_name="storage_id",
domain=[("is_root_directory", "=", True)],
string="Root Directories",
auto_join=False,
readonly=False,
Expand Down
9 changes: 9 additions & 0 deletions dms/tests/test_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ def test_count_total_elements(self):
def test_size(self):
self.assertTrue(self.directory.size, msg="The directory should have a size")

@users("dms-manager", "dms-user")
def test_check_name_root_sub(self):
"""A sub-directory and a root directory can have the same name."""
new_sub_directory = self.create_directory(directory=self.directory)
generated_name = new_sub_directory.name
new_root_directory = self.create_directory(storage=self.storage)
new_root_directory.name = generated_name
self.assertEqual(new_root_directory.name, new_sub_directory.name)

@users("dms-manager", "dms-user")
def test_name_get(self):
directory = self.subdirectory.with_context(dms_directory_show_path=True)
Expand Down
Loading