Ejemplo n.º 1
0
 def test_three_relations(self):
     sql = chained_join(self.Catalog.category, self.Category.sub_category, self.SubCategory.product)
     assert str(sql) == (
         "category JOIN sub_category ON category._id = "
         "sub_category._category_id JOIN product ON sub_category._id = "
         "product._sub_category_id"
     )
Ejemplo n.º 2
0
 def test_three_relations(self, Catalog, Category, SubCategory):
     sql = chained_join(Catalog.category, Category.sub_category,
                        SubCategory.product)
     assert str(sql) == (
         'category JOIN sub_category ON category._id = '
         'sub_category._category_id JOIN product ON sub_category._id = '
         'product._sub_category_id')
Ejemplo n.º 3
0
 def test_two_relations(self, Catalog, Category):
     sql = chained_join(Catalog.categories, Category.sub_categories)
     assert str(sql) == (
         'catalog_category JOIN category ON category._id = '
         'catalog_category.category_id JOIN category_subcategory ON '
         'category._id = category_subcategory.category_id JOIN '
         'sub_category ON sub_category._id = '
         'category_subcategory.subcategory_id')
Ejemplo n.º 4
0
 def test_two_relations(self):
     sql = chained_join(self.Catalog.categories, self.Category.sub_categories)
     assert str(sql) == (
         "catalog_category JOIN category ON category._id = "
         "catalog_category.category_id JOIN category_subcategory ON "
         "category._id = category_subcategory.category_id JOIN "
         "sub_category ON sub_category._id = "
         "category_subcategory.subcategory_id"
     )
Ejemplo n.º 5
0
 def test_two_relations(self, Catalog, Category):
     sql = chained_join(
         Catalog.category,
         Category.sub_category
     )
     assert str(sql) == (
         'category JOIN sub_category ON category._id = '
         'sub_category._category_id'
     )
Ejemplo n.º 6
0
 def test_three_relations(self, Catalog, Category, SubCategory):
     sql = chained_join(Catalog.categories, Category.sub_categories,
                        SubCategory.products)
     assert str(sql) == (
         'catalog_category JOIN category ON category._id = '
         'catalog_category.category_id JOIN category_subcategory ON '
         'category._id = category_subcategory.category_id JOIN sub_category'
         ' ON sub_category._id = category_subcategory.subcategory_id JOIN '
         'subcategory_product ON sub_category._id = '
         'subcategory_product.subcategory_id JOIN product ON product._id ='
         ' subcategory_product.product_id')
Ejemplo n.º 7
0
 def test_three_relations(self):
     sql = chained_join(self.Catalog.categories, self.Category.sub_categories, self.SubCategory.products)
     assert str(sql) == (
         "catalog_category JOIN category ON category._id = "
         "catalog_category.category_id JOIN category_subcategory ON "
         "category._id = category_subcategory.category_id JOIN sub_category"
         " ON sub_category._id = category_subcategory.subcategory_id JOIN "
         "subcategory_product ON sub_category._id = "
         "subcategory_product.subcategory_id JOIN product ON product._id ="
         " subcategory_product.product_id"
     )
Ejemplo n.º 8
0
 def test_three_relations(self, Catalog, Category, SubCategory):
     sql = chained_join(
         Catalog.category,
         Category.sub_category,
         SubCategory.product
     )
     assert str(sql) == (
         'category JOIN sub_category ON category._id = '
         'sub_category._category_id JOIN product ON sub_category._id = '
         'product._sub_category_id'
     )
Ejemplo n.º 9
0
 def test_two_relations(self, Catalog, Category):
     sql = chained_join(
         Catalog.categories,
         Category.sub_categories
     )
     assert str(sql) == (
         'catalog_category JOIN category ON category._id = '
         'catalog_category.category_id JOIN category_subcategory ON '
         'category._id = category_subcategory.category_id JOIN '
         'sub_category ON sub_category._id = '
         'category_subcategory.subcategory_id'
     )
Ejemplo n.º 10
0
 def test_three_relations(self, Catalog, Category, SubCategory):
     sql = chained_join(
         Catalog.categories,
         Category.sub_categories,
         SubCategory.products
     )
     assert str(sql) == (
         'catalog_category JOIN category ON category._id = '
         'catalog_category.category_id JOIN category_subcategory ON '
         'category._id = category_subcategory.category_id JOIN sub_category'
         ' ON sub_category._id = category_subcategory.subcategory_id JOIN '
         'subcategory_product ON sub_category._id = '
         'subcategory_product.subcategory_id JOIN product ON product._id ='
         ' subcategory_product.product_id'
     )
Ejemplo n.º 11
0
 def test_two_relations(self):
     sql = chained_join(self.Catalog.category, self.Category.sub_category)
     assert str(sql) == ("category JOIN sub_category ON category._id = " "sub_category._category_id")
Ejemplo n.º 12
0
 def test_simple_join(self):
     assert str(chained_join(self.Catalog.category)) == "category"
Ejemplo n.º 13
0
 def test_simple_join(self, Catalog):
     assert str(chained_join(Catalog.categories)) == (
         'catalog_category JOIN category ON '
         'category._id = catalog_category.category_id'
     )
Ejemplo n.º 14
0
 def test_two_relations(self, Catalog, Category):
     sql = chained_join(Catalog.category, Category.sub_category)
     assert str(sql) == ('category JOIN sub_category ON category._id = '
                         'sub_category._category_id')
Ejemplo n.º 15
0
 def test_simple_join(self, Catalog):
     assert str(chained_join(Catalog.category)) == 'category'
Ejemplo n.º 16
0
 def test_two_relations(self):
     sql = chained_join(self.Catalog.categories,
                        self.Category.sub_categories)
     assert str(sql) == ('category JOIN sub_category ON category._id = '
                         'sub_category._category_id')
Ejemplo n.º 17
0
 def test_simple_join(self, Catalog):
     assert str(chained_join(Catalog.categories)) == (
         'catalog_category JOIN category ON '
         'category._id = catalog_category.category_id')
Ejemplo n.º 18
0
 def test_simple_join(self, Catalog):
     assert str(chained_join(Catalog.category)) == 'category'
Ejemplo n.º 19
0
 def test_simple_join(self):
     assert str(chained_join(self.Catalog.categories)) == (
         "catalog_category JOIN category ON " "category._id = catalog_category.category_id"
     )
Ejemplo n.º 20
0
 def test_simple_join(self):
     assert str(chained_join(self.Catalog.categories)) == 'category'