def test_exclude_references(self): field = RootField("invoice-id", \ excludes=[ExcludedElement("http://foo.bar.com/invoice", "id")]) assert 1 == len(field.excluded_elements()) assert "http://foo.bar.com/invoice" == field.excluded_elements()[0].namespace_uri() assert"id" == field.excluded_elements()[0].localname()
def test_exclude_references(self): db = Database("testdb") field = RootField("invoice-id", excludes=[ExcludedElement("http://foo.bar.com/invoice", "id")]) self.assertEqual(1, len(field.excluded_elements())) self.assertEqual("http://foo.bar.com/invoice", field.excluded_elements()[0].namespace_uri()) self.assertEqual("id", field.excluded_elements()[0].localname())
def test_exclude_references(self): field = RootField("invoice-id", \ excludes=[ExcludedElement("http://foo.bar.com/invoice", "id")]) assert 1 == len(field.excluded_elements()) assert "http://foo.bar.com/invoice" == field.excluded_elements( )[0].namespace_uri() assert "id" == field.excluded_elements()[0].localname()
def test_create_range_field(self): db = Database("foo") field = RootField("invoice-id", False) db.add_field(field) range_field = FieldRangeIndex("int", "invoice-id") db.add_index(range_field) index = db.field_range_indexes()[0] assert "invoice-id" == index.field_name() assert "int" == index.scalar_type() indexes = db.field_range_indexes() assert 1 == len(indexes)