def test_band_by_name_not_superuser(self): client = graphQLClient(schema) self.context_value.user = self.joeuser executed = client.execute("""{ bandByName(name:"test band") { name, hometown } }""", context_value=self.context_value) assert "errors" in executed
def test_all_bands_not_superuser(self): client = graphQLClient(schema) self.context_value.user = self.joeuser executed = client.execute("""{ allBands { band { name, hometown } } }""", context_value=self.context_value) assert executed == {"data": {'allBands': []}}
def test_band_by_name_superuser(self): client = graphQLClient(schema) self.context_value.user = self.super executed = client.execute("""{ bandByName(name:"test band") { name, hometown } }""", context_value=self.context_value) assert executed == { "data": { "bandByName": { "name": "test band", "hometown": "Seattle" } } }
def test_all_bands_superuser(self): client = graphQLClient(schema) self.context_value.user = self.super executed = client.execute("""{ allBands { band { name, hometown } } }""", context_value=self.context_value) assert executed == { "data": { 'allBands': [{ 'band': { 'name': 'test band', 'hometown': 'Seattle' } }] } }