Exemple #1
0
class TestAPrivateWishList(TestCase):
    def setUp(self):
        self.owner = User(id=1)
        self.another_user = User(id=2)
        self.wishlist = WishList(owner=self.owner)

    def test_is_visible_only_to_its_owner(self):
        self.assertTrue(self.wishlist.is_allowed_to_see(self.owner))
        self.assertFalse(self.wishlist.is_allowed_to_see(self.another_user))

    def test_can_only_be_edited_by_its_owner(self):
        self.assertTrue(self.wishlist.is_allowed_to_edit(self.owner))
        self.assertFalse(self.wishlist.is_allowed_to_edit(self.another_user))
class TestAPrivateWishList(TestCase):

    def setUp(self):
        self.owner = User(id=1)
        self.another_user = User(id=2)
        self.wishlist = WishList(owner=self.owner)

    def test_is_visible_only_to_its_owner(self):
        self.assertTrue(self.wishlist.is_allowed_to_see(self.owner))
        self.assertFalse(self.wishlist.is_allowed_to_see(self.another_user))

    def test_can_only_be_edited_by_its_owner(self):
        self.assertTrue(self.wishlist.is_allowed_to_edit(self.owner))
        self.assertFalse(self.wishlist.is_allowed_to_edit(self.another_user))
Exemple #3
0
class TestASharedWishList(TestCase):
    def setUp(self):
        self.wishlist = WishList(visibility=WishList.SHARED)

    def test_is_visible_to_anyone(self):
        user = User()
        self.assertTrue(self.wishlist.is_allowed_to_see(user))
Exemple #4
0
class TestAPublicWishList(TestCase):
    def setUp(self):
        self.wishlist = WishList(visibility=WishList.PUBLIC)

    def test_is_visible_to_anyone(self):
        user = User()
        self.assertTrue(self.wishlist.is_allowed_to_see(user))
class TestASharedWishList(TestCase):

    def setUp(self):
        self.wishlist = WishList(visibility=WishList.SHARED)

    def test_is_visible_to_anyone(self):
        user = User()
        self.assertTrue(self.wishlist.is_allowed_to_see(user))
class TestAPublicWishList(TestCase):

    def setUp(self):
        self.wishlist = WishList(visibility=WishList.PUBLIC)

    def test_is_visible_to_anyone(self):
        user = User()
        self.assertTrue(self.wishlist.is_allowed_to_see(user))