From bb3ea850f250f01cd68db2f77644fcd6c7b45fdc Mon Sep 17 00:00:00 2001 From: Blake Eggleston Date: Sun, 26 May 2013 08:16:21 -0700 Subject: [PATCH] adding test around deleting of model attributes --- cqlengine/tests/model/test_class_construction.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cqlengine/tests/model/test_class_construction.py b/cqlengine/tests/model/test_class_construction.py index 77b1d737..36aa11e9 100644 --- a/cqlengine/tests/model/test_class_construction.py +++ b/cqlengine/tests/model/test_class_construction.py @@ -117,7 +117,18 @@ class TestModelClassFunction(BaseCassEngTestCase): """ Test that metadata defined in one class, is not inherited by subclasses """ - + + def test_del_attribute_is_assigned_properly(self): + """ Tests that columns that can be deleted have the del attribute """ + class DelModel(Model): + key = columns.Integer(primary_key=True) + data = columns.Integer(required=False) + + model = DelModel(key=4, data=5) + del model.data + with self.assertRaises(AttributeError): + del model.key + class TestManualTableNaming(BaseCassEngTestCase): class RenamedTest(cqlengine.Model):