diff --git a/pelican/tests/output/basic/drafts/a-draft-article-without-date.html b/pelican/tests/output/basic/drafts/a-draft-article-without-date.html
new file mode 100644
index 00000000..5187afab
--- /dev/null
+++ b/pelican/tests/output/basic/drafts/a-draft-article-without-date.html
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom/drafts/a-draft-article-without-date.html b/pelican/tests/output/custom/drafts/a-draft-article-without-date.html
new file mode 100644
index 00000000..3c61b23c
--- /dev/null
+++ b/pelican/tests/output/custom/drafts/a-draft-article-without-date.html
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/output/custom_locale/drafts/a-draft-article-without-date.html b/pelican/tests/output/custom_locale/drafts/a-draft-article-without-date.html
new file mode 100644
index 00000000..327d6460
--- /dev/null
+++ b/pelican/tests/output/custom_locale/drafts/a-draft-article-without-date.html
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pelican/tests/test_plugins.py b/pelican/tests/test_plugins.py
index 1adbbb5c..4f62c4a5 100644
--- a/pelican/tests/test_plugins.py
+++ b/pelican/tests/test_plugins.py
@@ -66,35 +66,38 @@ class PluginTest(unittest.TestCase):
self.assertEqual(pelican.__path__, old_path)
def test_get_namespace_plugins(self):
- # without plugins
- ns_plugins = get_namespace_plugins()
- self.assertEqual(len(ns_plugins), 0)
+ # existing namespace plugins
+ existing_ns_plugins = get_namespace_plugins()
# with plugin
with tmp_namespace_path(self._NS_PLUGIN_FOLDER):
ns_plugins = get_namespace_plugins()
- self.assertEqual(len(ns_plugins), 1)
+ self.assertEqual(len(ns_plugins), len(existing_ns_plugins)+1)
self.assertIn('pelican.plugins.ns_plugin', ns_plugins)
self.assertEqual(
ns_plugins['pelican.plugins.ns_plugin'].NAME,
'namespace plugin')
- # should be back to 0 outside `with`
+ # should be back to existing namespace plugins outside `with`
ns_plugins = get_namespace_plugins()
- self.assertEqual(len(ns_plugins), 0)
+ self.assertEqual(ns_plugins, existing_ns_plugins)
def test_load_plugins(self):
- # no plugins
- plugins = load_plugins({})
- self.assertEqual(len(plugins), 0)
+ def get_plugin_names(plugins):
+ return set(
+ plugin.NAME if hasattr(plugin, 'NAME') else plugin.__name__
+ for plugin in plugins)
+
+ # existing namespace plugins
+ existing_ns_plugins = load_plugins({})
with tmp_namespace_path(self._NS_PLUGIN_FOLDER):
# with no `PLUGINS` setting, load namespace plugins
plugins = load_plugins({})
- self.assertEqual(len(plugins), 1, plugins)
+ self.assertEqual(len(plugins), len(existing_ns_plugins)+1, plugins)
self.assertEqual(
- {'namespace plugin'},
- set(plugin.NAME for plugin in plugins))
+ {'namespace plugin'} | get_plugin_names(existing_ns_plugins),
+ get_plugin_names(plugins))
# disable namespace plugins with `PLUGINS = []`
SETTINGS = {
@@ -103,7 +106,7 @@ class PluginTest(unittest.TestCase):
plugins = load_plugins(SETTINGS)
self.assertEqual(len(plugins), 0, plugins)
- # using `PLUGINS`
+ # with `PLUGINS`, load only specified plugins
# normal plugin
SETTINGS = {
@@ -114,7 +117,7 @@ class PluginTest(unittest.TestCase):
self.assertEqual(len(plugins), 1, plugins)
self.assertEqual(
{'normal plugin'},
- set(plugin.NAME for plugin in plugins))
+ get_plugin_names(plugins))
# namespace plugin short
SETTINGS = {
@@ -124,7 +127,7 @@ class PluginTest(unittest.TestCase):
self.assertEqual(len(plugins), 1, plugins)
self.assertEqual(
{'namespace plugin'},
- set(plugin.NAME for plugin in plugins))
+ get_plugin_names(plugins))
# namespace plugin long
SETTINGS = {
@@ -134,7 +137,7 @@ class PluginTest(unittest.TestCase):
self.assertEqual(len(plugins), 1, plugins)
self.assertEqual(
{'namespace plugin'},
- set(plugin.NAME for plugin in plugins))
+ get_plugin_names(plugins))
# normal and namespace plugin
SETTINGS = {
@@ -145,4 +148,4 @@ class PluginTest(unittest.TestCase):
self.assertEqual(len(plugins), 2, plugins)
self.assertEqual(
{'normal plugin', 'namespace plugin'},
- set(plugin.NAME for plugin in plugins))
+ get_plugin_names(plugins))
diff --git a/samples/content/draft_article without_date.rst b/samples/content/draft_article without_date.rst
new file mode 100644
index 00000000..5ac62034
--- /dev/null
+++ b/samples/content/draft_article without_date.rst
@@ -0,0 +1,7 @@
+A draft article without date
+############################
+
+:status: draft
+
+This is a draft article, it should live under the /drafts/ folder and not be
+listed anywhere else.