aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlava Bacherikov <slava@bacher09.org>2012-08-16 00:59:11 +0300
committerSlava Bacherikov <slava@bacher09.org>2012-08-16 00:59:11 +0300
commit3c7f552e852073966ebbe4c7d677eeae36188870 (patch)
tree28da94271336bae7d315d5474674bbde882d82c0
parentAdd tests to model_stats application (diff)
downloadgentoo-packages-3c7f552e852073966ebbe4c7d677eeae36188870.tar.gz
gentoo-packages-3c7f552e852073966ebbe4c7d677eeae36188870.tar.bz2
gentoo-packages-3c7f552e852073966ebbe4c7d677eeae36188870.zip
Improve generic tests
-rw-r--r--gpackages/apps/generic/tests.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gpackages/apps/generic/tests.py b/gpackages/apps/generic/tests.py
index a3fb050..7192f21 100644
--- a/gpackages/apps/generic/tests.py
+++ b/gpackages/apps/generic/tests.py
@@ -10,9 +10,9 @@ from django.db import models
from django.test.client import RequestFactory
from django.http import Http404
from operator import attrgetter
-from time import sleep
from . import views
import re
+import datetime
class Tag(models.Model):
name = models.CharField(unique = True, max_length = 40)
@@ -118,9 +118,9 @@ class SimpleTest(TestCase):
m_obj.tags.add(tags[5])
# For changed updated_datetime
- sleep(3)
- mu_obj.text = 'Updated'
- mu_obj.save()
+ nd = datetime.datetime.now() + datetime.timedelta(0, 5)
+ Messages.objects.filter(pk = mu_obj.pk). \
+ update(text = 'Updated', updated_datetime = nd)
def test_basic_addition(self):
self.assertEqual(1 + 1, 2)