Index: dashboard/dashboard/datastore_hooks_test.py |
diff --git a/dashboard/dashboard/datastore_hooks_test.py b/dashboard/dashboard/datastore_hooks_test.py |
index 503938bda3db93f6c5cc17532727076722be3435..59244df1bd63b2af4f23e240a99a3164831360e6 100644 |
--- a/dashboard/dashboard/datastore_hooks_test.py |
+++ b/dashboard/dashboard/datastore_hooks_test.py |
@@ -177,6 +177,17 @@ class DatastoreHooksTest(testing_common.TestCase): |
datastore_hooks.SetPrivilegedRequest() |
self._CheckQueryResults(True) |
+ def testQuery_SinglePrivilegedRequest_InternalOnlyFetched(self): |
+ self.UnsetCurrentUser() |
+ datastore_hooks.SetSinglePrivilegedRequest() |
+ # Not using _CheckQueryResults because this only affects a single query. |
+ # First query has internal results. |
+ rows = graph_data.Row.query().filter(graph_data.Row.value == 20).fetch() |
+ self.assertEqual(2, len(rows)) |
+ # Second query does not. |
+ rows = graph_data.Row.query().filter(graph_data.Row.value == 20).fetch() |
+ self.assertEqual(1, len(rows)) |
+ |
def _CheckGet(self, include_internal): |
m = ndb.Key('Master', 'ChromiumPerf').get() |
self.assertEqual(m.key.string_id(), 'ChromiumPerf') |