示例#1
0
文件: test_forms.py 项目: ella/esus
 def test_existing_users_valid(self):
     table_access_form = TableAccessForm(
         {"can_read": False, "can_write": False, "can_delete": False, "username": "******"}
     )
     self.assert_true(table_access_form.is_valid())
示例#2
0
文件: test_forms.py 项目: ella/esus
 def test_access_detection_partial(self):
     table_access_form = TableAccessForm(
         {"can_read": True, "can_write": False, "can_delete": True, "username": "******"}
     )
     self.assert_true(table_access_form.is_valid())
     self.assert_equals(["read", "delete"], table_access_form.get_access_names())
示例#3
0
文件: test_forms.py 项目: ella/esus
 def test_nonexisting_users_not_valid(self):
     table_access_form = TableAccessForm(
         {"can_read": False, "can_write": False, "can_delete": False, "username": "******"}
     )
     self.assert_false(table_access_form.is_valid())