Exemplo n.º 1
0
 def setUp(self):
     self.client = h.make_test_app()
     self.network = Network()
     self.network.title = 'Net'
     self.network.slug = 'net'
     db.session.add(self.network)
     db.session.commit()
     self.context = ValidationContext(network=self.network)
Exemplo n.º 2
0
 def setUp(self):
     self.client = h.make_test_app()
     self.network = Network.create({'title': 'Net', 'slug': 'net'})
     self.eschema = Schema.create(self.network, Schema.ENTITY,
                             h.TEST_ENTITY_SCHEMA)
     self.nschema = Schema.create(self.network, Schema.RELATION,
                             h.TEST_RELATION_SCHEMA)
     self.entity = self.network.Entity.create(self.eschema, {'title': 'The Man'})
Exemplo n.º 3
0
 def setUp(self):
     self.client = h.make_test_app()
     self.network = Network.create({'title': 'Net', 'slug': 'net'})
     self.schema = Schema.create(self.network, Schema.ENTITY,
                                 h.TEST_ENTITY_SCHEMA)
     self.rschema = Schema.create(self.network, Schema.RELATION,
                                 h.TEST_RELATION_SCHEMA)
     db.session.commit()
     self.context = ValidationContext(network=self.network)
Exemplo n.º 4
0
 def setUp(self):
     self.app = make_test_app()
     self.app.post('/api/1/networks',
                   headers=AUTHZ_HEADER,
                   data=NETWORK_FIXTURE)
     network = Network.by_slug(NETWORK_FIXTURE['slug'])
     Schema.create(network, Schema.RELATION, h.TEST_RELATION_SCHEMA)
     Schema.create(network, Schema.ENTITY, h.TEST_ENTITY_SCHEMA)
     db.session.commit()
Exemplo n.º 5
0
 def setUp(self):
     self.client = h.make_test_app()
     self.network = Network.create({'title': 'Net', 'slug': 'net'})
     self.schema = Schema.create(self.network, Schema.ENTITY,
                                 h.TEST_ENTITY_SCHEMA)
     self.rschema = Schema.create(self.network, Schema.RELATION,
                                  h.TEST_RELATION_SCHEMA)
     db.session.commit()
     self.context = ValidationContext(network=self.network)
Exemplo n.º 6
0
 def setUp(self):
     self.app = make_test_app()
     self.app.post('/api/1/networks',
                 headers=AUTHZ_HEADER,
                 data=NETWORK_FIXTURE)
     network = Network.by_slug(NETWORK_FIXTURE['slug'])
     Schema.create(network, Schema.RELATION,
                   h.TEST_RELATION_SCHEMA)
     Schema.create(network, Schema.ENTITY,
                   h.TEST_ENTITY_SCHEMA)
     db.session.commit()
Exemplo n.º 7
0
 def setUp(self):
     self.client = h.make_test_app()
     self.network = Network.create({'title': 'Net', 'slug': 'net'})
     self.schema = Schema.create(self.network, Schema.RELATION,
                                 h.TEST_RELATION_SCHEMA)
     db.session.commit()
     self.eschema = Schema.create(self.network, Schema.ENTITY,
                                  h.TEST_ENTITY_SCHEMA)
     self.context = ValidationContext(network=self.network)
     entity = deepcopy(TEST_ENTITY)
     entity['network'] = self.network.slug
     entity = validate_entity(entity, self.eschema, self.context)
     entity['title'] = 'Alice'
     a = self.network.Entity.create(self.eschema, entity)
     entity['title'] = 'Bob'
     b = self.network.Entity.create(self.eschema, entity)
     TEST_RELATION['source'] = a.id
     TEST_RELATION['target'] = b.id
     db.session.commit()
Exemplo n.º 8
0
 def setUp(self):
     self.client = h.make_test_app()
     self.network = Network.create({'title': 'Net', 'slug': 'net'})
     self.schema = Schema.create(self.network, Schema.RELATION,
                                 h.TEST_RELATION_SCHEMA)
     db.session.commit()
     self.eschema = Schema.create(self.network, Schema.ENTITY,
                                  h.TEST_ENTITY_SCHEMA)
     self.context = ValidationContext(network=self.network)
     entity = deepcopy(TEST_ENTITY)
     entity['network'] = self.network.slug
     entity = validate_entity(entity, self.eschema, self.context)
     entity['title'] = 'Alice'
     a = self.network.Entity.create(self.eschema, entity)
     entity['title'] = 'Bob'
     b = self.network.Entity.create(self.eschema, entity)
     TEST_RELATION['source'] = a.id
     TEST_RELATION['target'] = b.id
     db.session.commit()
Exemplo n.º 9
0
 def setUp(self):
     self.app = make_test_app()
     self.make_fixtures()
Exemplo n.º 10
0
 def setUp(self):
     self.app = make_test_app()
     self.make_fixtures()
Exemplo n.º 11
0
 def setUp(self):
     self.client = h.make_test_app()
     self.network = Network.create({'title': 'Net', 'slug': 'net'})
Exemplo n.º 12
0
 def setUp(self):
     self.client = h.make_test_app()
     self.network = Network.create({'title': 'Net', 'slug': 'net'})
     self.schema = Schema.create(self.network, Schema.ENTITY,
                                 h.TEST_ENTITY_SCHEMA)
Exemplo n.º 13
0
 def setUp(self):
     self.client = h.make_test_app()
     self.network = Network.create({'title': 'Net', 'slug': 'net'})
Exemplo n.º 14
0
 def setUp(self):
     self.client = h.make_test_app()
     self.network = Network.create({'title': 'Net', 'slug': 'net'})
     self.schema = Schema.create(self.network, Schema.ENTITY,
                                 h.TEST_ENTITY_SCHEMA)