aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_scheduling.py
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2014-02-28 08:49:41 -0300
committerLibravatarAgustin Henze <tin@sluc.org.ar>2014-02-28 08:49:41 -0300
commit0f1e24f7888ba16fe5629c57fd00f0deacb63e5e (patch)
tree7153a3a11b766f375b1d1c0a7adc599e0a9f9c55 /tests/test_scheduling.py
parent04fc43563d3d5d4218004690b5e14c19c67bdcbc (diff)
parent2828399ba5cbb14502b023d4de1ba02f13dd5055 (diff)
Merge tag 'upstream/6.3.0'
Upstream version 6.3.0
Diffstat (limited to 'tests/test_scheduling.py')
-rw-r--r--tests/test_scheduling.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_scheduling.py b/tests/test_scheduling.py
index 264d1c5..c9cda42 100644
--- a/tests/test_scheduling.py
+++ b/tests/test_scheduling.py
@@ -1,5 +1,13 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
+
+# This code is so you can run the samples without installing the package,
+# and should be before any import touching nikola, in any file under tests/
+import os
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
from .base import BaseTestCase
import datetime
from nose.plugins.skip import SkipTest
@@ -24,6 +32,17 @@ class TestScheduling(BaseTestCase):
if not _freeze_time:
raise SkipTest('freezegun not installed')
+ d = [name for name in sys.modules if name.startswith("six.moves.")]
+ self.deleted = {}
+ for name in d:
+ self.deleted[name] = sys.modules[name]
+ del sys.modules[name]
+
+ @classmethod
+ def tearDown(self):
+ for name, mod in self.deleted.items():
+ sys.modules[name] = mod
+
@freeze_time(NOW)
def test_get_date(self):
from nikola.plugins.command.new_post import get_date