Permalink
Browse files

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

  • Loading branch information...
1 parent 0b8215a commit db0a3d2d52341517792b864a7e1db2971cbf92db @ofri committed Dec 23, 2013
Showing with 10 additions and 2 deletions.
  1. +10 −2 links/tests.py
View
@@ -1,14 +1,15 @@
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
from django.core.files import File
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()

0 comments on commit db0a3d2

Please sign in to comment.