Created
August 20, 2010 23:08
-
-
Save jgeewax/541380 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import with_statement | |
import unittest | |
from gaetestbed import DataStoreTestCase | |
from myproject.models import MyModel | |
class MyTestCase(unittest.TestCase, DataStoreTestCase): | |
def test_num_queries(self): | |
# Check that no more than 1 query is run in this block of code | |
with self.max_queries(10): | |
# Whatever you do in here can't take more than 10 queries | |
# Otherwise the test case will fail. | |
MyModel(name='Name').put() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment