Exemplo n.º 1
0
 def test_data_delete_with_permissions(self):
     signup(self, 'alice', '*****@*****.**', 'alice_secret')
     signin(self, 'alice', 'alice_secret')
     logout(self)
     signup(self, 'bob', '*****@*****.**', 'bob_secret')
     signin(self, 'bob', 'bob_secret')
     create_graph(self)
     create_schema(self)
     create_type(self)
     create_data(self)
     add_permission(self, 'alice', CREATE_COLLAB)
     add_permission(self, 'alice', DATA_VIEW)
     add_permission(self, 'alice', DATA_CHANGE)
     add_permission(self, 'alice', DATA_DELETE)
     logout(self)
     signin(self, 'alice', 'alice_secret')
     self.browser.find_link_by_href('/graphs/bobs-graph/').first.click()
     spin_click(self.browser.find_by_xpath("//a[@id='dataMenu']").first,
                                           self.browser.find_by_xpath("//div[@id='dataBrowse']/table/tbody/tr/td/a[@class='dataOption list']").first)
     self.browser.find_by_xpath("//td/a[@title='Edit node']").first.click()
     self.browser.find_by_xpath("//span[@class='buttonLinkOption buttonLinkRight']/a[text()='Remove']").first.click()
     self.browser.choose('confirm', '1')
     self.browser.find_by_xpath("//input[@type='submit']").first.click()
     text = self.browser.find_by_xpath(
         "//div[@id='content2']/div[@class='indent']").first.value
     spin_assert(lambda: self.assertNotEqual(text.find('Nodes: 0'), -1))
     Graph.objects.get(name="Bob's graph").destroy()
Exemplo n.º 2
0
 def test_data_change_with_permissions(self):
     signup(self, 'alice', '*****@*****.**', 'alice_secret')
     signin(self, 'alice', 'alice_secret')
     logout(self)
     signup(self, 'bob', '*****@*****.**', 'bob_secret')
     signin(self, 'bob', 'bob_secret')
     create_graph(self)
     create_schema(self)
     create_type(self)
     create_data(self)
     add_permission(self, 'alice', CREATE_COLLAB)
     add_permission(self, 'alice', DATA_VIEW)
     add_permission(self, 'alice', DATA_CHANGE)
     logout(self)
     signin(self, 'alice', 'alice_secret')
     self.browser.find_link_by_href('/graphs/bobs-graph/').first.click()
     spin_click(self.browser.find_by_xpath("//a[@id='dataMenu']").first,
                                           self.browser.find_by_xpath("//div[@id='dataBrowse']/table/tbody/tr/td/a[@class='dataOption list']").first)
     self.browser.find_by_xpath("//td/a[@title='Edit node']").first.click()
     self.browser.find_by_xpath(
         "//input[@id='id_Name']").first.fill("Alice's node")
     self.browser.find_by_xpath("//input[@type='submit']").first.click()
     text = self.browser.find_by_xpath("//table[@id='content_table']/tbody/tr/td")[1].value
     spin_assert(lambda: self.assertEqual(text, "Alice's node"))
     Graph.objects.get(name="Bob's graph").destroy()
Exemplo n.º 3
0
 def test_data_change_without_permissions(self):
     signup(self, 'alice', '*****@*****.**', 'alice_secret')
     signin(self, 'alice', 'alice_secret')
     logout(self)
     signup(self, 'bob', '*****@*****.**', 'bob_secret')
     signin(self, 'bob', 'bob_secret')
     create_graph(self)
     create_schema(self)
     create_type(self)
     create_data(self)
     add_permission(self, 'alice', CREATE_COLLAB)
     add_permission(self, 'alice', DATA_VIEW)
     logout(self)
     signin(self, 'alice', 'alice_secret')
     self.browser.find_link_by_href('/graphs/bobs-graph/').first.click()
     spin_click(
         self.browser.find_by_xpath("//a[@id='dataMenu']").first,
         self.browser.find_by_xpath(
             "//div[@id='dataBrowse']/table/tbody/tr/td/a[@class='dataOption list']"
         ).first)
     self.browser.find_by_xpath("//td/a[@title='Edit node']").first.click()
     text = self.browser.find_by_xpath(
         "//div[@class='heading']/h1").first.value
     spin_assert(lambda: self.assertNotEqual(text.find("403"), -1))
     Graph.objects.get(name="Bob's graph").destroy()
Exemplo n.º 4
0
 def test_data_view_without_permissions(self):
     signup(self, 'alice', '*****@*****.**', 'alice_secret')
     signin(self, 'alice', 'alice_secret')
     logout(self)
     signup(self, 'bob', '*****@*****.**', 'bob_secret')
     signin(self, 'bob', 'bob_secret')
     create_graph(self)
     create_schema(self)
     create_type(self)
     create_data(self)
     add_permission(self, 'alice', CREATE_COLLAB)
     logout(self)
     signin(self, 'alice', 'alice_secret')
     self.browser.find_link_by_href('/graphs/bobs-graph/').first.click()
     spin_click(self.browser.find_by_xpath("//a[@id='dataMenu']").first,
                                           self.browser.find_by_xpath("//div[@id='dataBrowse']/table/tbody/tr/td/a[@class='dataOption list']").first)
     text = self.browser.find_by_xpath(
         "//div[@class='heading']/h1").first.value
     spin_assert(lambda: self.assertNotEqual(text.find("403"), -1))
     Graph.objects.get(name="Bob's graph").destroy()