irongit

A parser inspired by the django orm.

all tests work

huncholanehuncholaneauthored
parent 3ebb5c3commit a961a069720f9d76d5ad7c03c7871bb8d57f1eeeBrowse files

2 files changed, +9 -1

+1-1parsers/manager.py
@@ -15,7 +15,7 @@ class Manager:
1515 """Create and save object"""
1616 cls = self.cls
1717 obj = cls(**kwargs)
18- self.append(obj)
18+ obj.save()
1919
2020 def all(self):
2121 return self.objects
+8-0tests/test_create.py
@@ -2,7 +2,15 @@ import parsers
22 import unittest
33
44
5+class Test(parsers.Parser):
6+ a = parsers.Field()
7+
8+
59 class TestCreate(unittest.TestCase):
610
11+ def test_create(self):
12+ t = Test('a')
13+ self.assertEqual(t.a, 'a')
14+
715 def test_nullable(self):
816 pass