示例#1
0
    def it_is_identified_by_a_unique_code(self):
        assert_equal(self.p.code, self.p.id)

        assert_equal(Product.objects(code=self.code).count(), 1)
        create_product(code=self.code)
        assert_equal(Product.objects(code=self.code).count(), 1)
        assert_raises(db.OperationError, create_product, code=self.code, force_insert=True)
示例#2
0
def setup():
    Variant.drop_collection()
    Product.drop_collection()
示例#3
0
 def it_has_a_static_slugify_method(self):
     assert_equal(Product.slugify(u"Test Slügify"), "test-slugify")