Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Unified Diff: dashboard/dashboard/datastore_hooks_test.py

Issue 1549583002: In /graph_json, check internal_only on Test entity and skip test for all Row entities. (Closed) Base URL: https://github.com/catapult-project/catapult@master
Patch Set: Fixed assertions Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dashboard/dashboard/datastore_hooks.py ('k') | dashboard/dashboard/debug_alert.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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')
« no previous file with comments | « dashboard/dashboard/datastore_hooks.py ('k') | dashboard/dashboard/debug_alert.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698