Modified:
branches/unhork/grassyknoll/tests/test_Model.py
Log:
Issue #159: Added test for __id__=False.
Modified: branches/unhork/grassyknoll/tests/test_Model.py
==============================================================================
--- branches/unhork/grassyknoll/tests/test_Model.py (original)
+++ branches/unhork/grassyknoll/tests/test_Model.py Wed Jan 7 01:21:34 2009
@@ -197,6 +197,13 @@
assert model.sub2.quantity.wrapped is int
assert model.sub3.quantity.wrapped is int
+
+def test_Model_without_id_with_Object():
+ norm = Norman.Object()
+ with Model(norm=norm) as model:
+ assert_sorted_equals(norm.__fields__, [])
+ model.size = int
+ assert_sorted_equals(norm.__fields__, ['size'])
def test_Model_with_Object():
norm = Norman.Object()
@@ -236,7 +243,7 @@
print norm.__fields__.keys()
assert_sorted_equals(norm.__fields__,
['__id__', 'size', 'color', 'price', 'description'])
-
+
def test_Model_with_TableMaker():
table = TableMaker.Table("the_table").default(indexed=True)
assert table.newField.indexed == True
@@ -274,6 +281,7 @@
assert table.description.indexed == False
assert_sorted_equals(table.__fields__,
['__id__', 'size', 'color', 'price', 'description'])
+
try:
from grassyknoll.collection.backends.lucene import LuceneCollection,
Smarts