importunittestfromgoogle.appengine.extimportndbfromtest_helper_gae3importTestGae3classModelTest(ndb.Model):
name=ndb.StringProperty(default='')
classTestCase(unittest.TestCase, TestGae3):
defsetUp(self):
super().setUp()
# For using queues names other then 'default', root_path dir must contain file# 'queue.yaml' (or 'queue.yml') with correct queues definition.# If root_path set to None, only 'default' queue is available.TestGae3.set_up(self, 'path/to/folder/with/queue.yaml') # activate GAE testbeddeftearDown(self):
TestGae3.tear_down(self) # deactivate GAE testbedsuper().tearDown()
deftest_record_count(self):
self.check_db_tables([
(ModelTest, 0), # no records in ModelTest
])
ModelTest().put()
self.tester.check_db_tables([
(ModelTest, 1), # one record in ModelTest
])