示例#1
0
 def test_acl_str(self):
     acl = GroupACL()
     self.assertIn('unspecified', force_text(acl))
     acl.language = self.language
     self.assertIn('language=English', force_text(acl))
     acl.subproject = self.subproject
     self.assertIn('subproject=Test/Test', force_text(acl))
     acl.subproject = None
     acl.project = self.project
     self.assertIn('project=Test', force_text(acl))
示例#2
0
 def test_acl_clean(self):
     acl = GroupACL()
     self.assertRaises(ValidationError, acl.clean)
     acl.project = self.project
     acl.subproject = self.subproject
     acl.save()
     self.assertIsNone(acl.project)
示例#3
0
文件: tests.py 项目: saily/weblate
 def test_acl_str(self):
     acl = GroupACL()
     self.assertIn(
         'unspecified', force_text(acl)
     )
     acl.language = self.language
     self.assertIn(
         'language=English', force_text(acl)
     )
     acl.subproject = self.subproject
     self.assertIn(
         'subproject=Test/Test', force_text(acl)
     )
     acl.subproject = None
     acl.project = self.project
     self.assertIn(
         'project=Test', force_text(acl)
     )
示例#4
0
文件: tests.py 项目: saily/weblate
 def test_acl_clean(self):
     acl = GroupACL()
     self.assertRaises(
         ValidationError,
         acl.clean
     )
     acl.project = self.project
     acl.subproject = self.subproject
     acl.save()
     self.assertIsNone(acl.project)