Exemplo n.º 1
0
class CoreProfileTest(TentdTestCase):
    def test_core_profile(self):
        self.entity = Entity(name="testuser")
        self.entity.save()

        with self.assertRaises(Exception):
            print self.entity.core
Exemplo n.º 2
0
class CoreProfileTest(TentdTestCase):
    def test_core_profile(self):
        self.entity = Entity(name="testuser")
        self.entity.save()

        with self.assertRaises(Exception):
            print self.entity.core
Exemplo n.º 3
0
    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
Exemplo n.º 4
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
Exemplo n.º 5
0
    def test_core_profile(self):
        self.entity = Entity(name="testuser")
        self.entity.save()

        with self.assertRaises(Exception):
            print self.entity.core
Exemplo n.º 6
0
 def test_create_identical_entity(self):
     """Check that properly inserting a document does not overwrite an existing one"""
     with self.assertRaises(db.NotUniqueError):
         entity = Entity(name="testuser")
         entity.save()
Exemplo n.º 7
0
    def test_core_profile(self):
        self.entity = Entity(name="testuser")
        self.entity.save()

        with self.assertRaises(Exception):
            print self.entity.core
Exemplo n.º 8
0
 def test_create_identical_entity(self):
     """Check that properly inserting a document does not overwrite an existing one"""
     with self.assertRaises(db.NotUniqueError):
         entity = Entity(name="testuser")
         entity.save()