Skip to content

Commit

Permalink
Merge branch 'develop-4' into non-named-cmsapps-error-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun authored Nov 5, 2024
2 parents 4ba5ff6 + 69962fe commit 95a62b7
Show file tree
Hide file tree
Showing 5 changed files with 338 additions and 276 deletions.
2 changes: 2 additions & 0 deletions cms/management/commands/subcommands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def create_parser(self, prog_name, subcommand):
parser = CommandParser(
prog=f"{os.path.basename(prog_name)} {subcommand}",
description=self.help or None,
missing_args_message=getattr(self, "missing_args_message", None),
called_from_command_line=getattr(self, "_called_from_command_line", None),
**kwargs
)
self.add_arguments(parser)
Expand Down
4 changes: 4 additions & 0 deletions cms/tests/test_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ def test_uninstall_plugins_with_plugin(self):
self.assertEqual(out.getvalue(), "1 'TextPlugin' plugins uninstalled\n")
self.assertEqual(CMSPlugin.objects.filter(plugin_type=PLUGIN).count(), 0)

def test_for_running_only_cms_command(self):
with self.assertRaises(CommandError) as e:
management.call_command('cms')
self.assertEqual(str(e.exception), 'Error: one of the available sub commands must be provided')

class PageFixtureManagementTestCase(NavextendersFixture, CMSTestCase):

Expand Down
2 changes: 1 addition & 1 deletion cms/tests/test_page_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ def test_page_obj_change_data_from_template_tags(self):
save_time = datetime.datetime.strptime(
actual_result[-19:],
"%Y-%m-%dT%H:%M:%S"
)
).replace(tzinfo=datetime.timezone.utc if settings.USE_TZ else None)

self.assertEqual(actual_result, desired_result)
# direct time comparisons are flaky, so we just check if the
Expand Down
Loading

0 comments on commit 95a62b7

Please sign in to comment.