Ejemplo n.º 1
0
class DeletionTest(TentdTestCase):
    """Test cascading deletes"""
    def test_post_delete(self):
        self.entity = Entity(name="testuser").save()
        self.post = Post(entity=self.entity,
                         schema="http://example.com/thisisnotrelevant",
                         content={
                             'a': 'b'
                         }).save()

        assert self.post in Post.objects
        assert self.post in self.entity.posts

        self.entity.delete(safe=True)

        assert self.post not in Post.objects
Ejemplo n.º 2
0
class DeletionTest(TentdTestCase):
    """Test cascading deletes"""

    def test_post_delete(self):
        self.entity = Entity(name="testuser").save()
        self.post = Post(
            entity=self.entity,
            schema="http://example.com/thisisnotrelevant",
            content={'a': 'b'}).save()

        assert self.post in Post.objects
        assert self.post in self.entity.posts
        
        self.entity.delete(safe=True)

        assert self.post not in Post.objects