import pytest

pytest.importorskip("datetime")

def test_load_module():
    __import__("modules.core.datetime")


@@ -11,103 +11,1679 @@
 est%0A
-%0Apytest.importorskip(%22datetime%22)%0A%0Adef test_load_module():%0A    __import__(%22modules.core.datetime%22
+from unittest import mock, TestCase%0A%0Aimport datetime%0Afrom freezegun import freeze_time%0A%0Aimport core.config%0Aimport core.input%0Aimport core.widget%0Aimport modules.core.datetime%0A%0Apytest.importorskip(%22datetime%22)%0A%0Adef build_module(args = %5B%5D):%0A    config = core.config.Config(args)%0A    return modules.core.datetime.Module(config=config, theme=None)%0A%0Adef build_widget():%0A    return core.widget.Widget()%0A%0Aclass DatetimeTest(TestCase):%0A    def setup_class(self):%0A        locale_patcher = mock.patch('locale.getdefaultlocale')%0A        locale_mock = locale_patcher.start()%0A        locale_mock.return_value = ('en-US', 'UTF-8')%0A%0A        self.widget = build_widget()%0A%0A    def test_load_module(self):%0A        __import__(%22modules.core.datetime%22)%0A%0A    @freeze_time('2020-10-15')%0A    def test_default_format(self):%0A        module = build_module()%0A        assert module.full_text(self.widget) == '10/15/2020 12:00:00 AM'%0A%0A    @freeze_time('2020-10-20')%0A    def test_custom_format(self):%0A        module = build_module(%5B'-p', 'datetime.format=%25Y.%25m.%25d'%5D)%0A        assert module.full_text(self.widget) == '2020.10.20'%0A%0A    @freeze_time('2020-01-10 10:20:30')%0A    @mock.patch('locale.getdefaultlocale')%0A    def test_invalid_locale(self, locale_mock):%0A        locale_mock.return_value = ('in-IN', 'UTF-0')%0A%0A        module = build_module()%0A        assert module.full_text(self.widget) == '01/10/2020 10:20:30 AM'%0A%0A    @mock.patch('core.input.register')%0A    def test_register_left_mouse_action(self, input_register_mock):%0A        module = build_module()%0A%0A        input_register_mock.assert_called_with(%0A            module,%0A            button=core.input.LEFT_MOUSE,%0A            cmd='calendar'%0A        
 )%0A%0A

Add datetime module tests