Browse files

tests fail

  • Loading branch information...
1 parent b4cbb5e commit 51450731a43458e5e361145fe0a832f3f10d2cda @andreysobol committed Feb 29, 2012
Showing with 19 additions and 1 deletion.
  1. +19 −1 testsobol/mainapp/tests.py
View
20 testsobol/mainapp/tests.py
@@ -11,7 +11,7 @@
from django.test import TestCase
from django.forms.models import model_to_dict
-from models import Bio, Request
+from models import Bio, Request, Log
class IndexViewTest(TestCase):
@@ -127,3 +127,21 @@ def test(self):
self.assertTrue((f.read()).find('error') != -1)
f.close()
Popen("rm " + d, stdout=PIPE, stderr=PIPE, shell=True)
+
+
+class Signal(TestCase):
+
+ def test(self):
+ b = Bio(bio="Noooooooooooooo", surname="Sobol", name="Andrey", other="pigeon post - white pigeon only", birth="1990-09-18", skype="andreysobol", jabber="pisecs@gmail.com", email="asobol@mail.ua", img="img/1.jpg")
+ b.save()
+ self.assertEqual(Log.objects.order_by('-id')[0].model,'Bio')
+ self.assertEqual(Log.objects.order_by('-id')[0].signal,'create')
+
+ b.bio="sfsf"
+ b.save()
+ self.assertEqual(Log.objects.order_by('-id')[0].model,'Bio')
+ self.assertEqual(Log.objects.order_by('-id')[0].signal,'update')
+
+ b.delete()
+ self.assertEqual(Log.objects.order_by('-id')[0].model,'Bio')
+ self.assertEqual(Log.objects.order_by('-id')[0].signal,'delete')

0 comments on commit 5145073

Please sign in to comment.