Merge pull request #212 from zakj/dev

Added GridFSProxy.__nonzero__ - thanks to zakj for the fix
This commit is contained in:
Ross Lawley
2011-06-30 01:57:00 -07:00
2 changed files with 19 additions and 1 deletions

View File

@@ -1300,6 +1300,21 @@ class FieldTest(unittest.TestCase):
TestFile.drop_collection()
def test_file_boolean(self):
"""Ensure that a boolean test of a FileField indicates its presence
"""
class TestFile(Document):
file = FileField()
testfile = TestFile()
self.assertFalse(bool(testfile.file))
testfile.file = 'Hello, World!'
testfile.file.content_type = 'text/plain'
testfile.save()
self.assertTrue(bool(testfile.file))
TestFile.drop_collection()
def test_geo_indexes(self):
"""Ensure that indexes are created automatically for GeoPointFields.
"""