Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add knesset object to links test to make it pass when running alone

  • Loading branch information...
commit db0a3d2d52341517792b864a7e1db2971cbf92db 1 parent 0b8215a
@ofri authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 links/tests.py
View
12 links/tests.py
@@ -1,6 +1,7 @@
import unittest
import re
import os
+import datetime
from django.conf import settings
from django.test.client import Client
from django.core.urlresolvers import reverse
@@ -8,7 +9,7 @@
from django.contrib.sites.models import Site
from django.template import Template, Context
from links.models import Link, LinkType, ModelWithLinks
-from mks.models import Member
+from mks.models import Member, Knesset
class TestViews(unittest.TestCase):
@@ -56,6 +57,9 @@ def tearDown(self):
class TestModels(unittest.TestCase):
def setUp(self):
+ self.knesset = Knesset.objects.create(
+ number=1,
+ start_date=datetime.date.today() - datetime.timedelta(10))
self.default_link = LinkType.objects.create(title='default')
self.mk = Member.objects.create(name='MK')
self.link = Link.objects.create(url='http://www.google.com/', title='google', content_object=self.mk)
@@ -64,4 +68,8 @@ def testLink(self):
self.assertEqual(self.link.link_type, self.default_link)
self.assertEqual(self.link.__unicode__(), u'google: http://www.google.com/')
-
+ def tearDown(self):
+ self.knesset.delete()
+ self.default_link.delete()
+ self.mk.delete()
+ self.link.delete()
Please sign in to comment.
Something went wrong with that request. Please try again.