Created
October 14, 2012 14:14
-
-
Save jeanphix/3888701 to your computer and use it in GitHub Desktop.
distillery use case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GroupSet(Set): | |
class __distillery__: | |
__model__ = Group | |
class admin: | |
name = 'admin' | |
class UserSet(Set) | |
class __distillery__: | |
__model__ = User | |
class jeanphix: | |
username = 'jeanphix' | |
groups = [GroupSet.admin] | |
class MyTest(unittest.TestCase): | |
def test_has_group_admin(self): | |
self.assertTrue(UserSet().jeanphix.has_group("admin")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment