Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(7)  |  Derive(0)  |  Import(0)

src/d/j/django-oscar-HEAD/tests/functional/dashboard/product_tests.py   django-oscar(Download)
    def test_doesnt_allow_duplicate_upc(self):
        G(Product, parent=None, upc="12345")
        category = G(Category)
        self.assertTrue(Product.objects.get(upc="12345"))
 
 
        try:
            product = Product.objects.get(title='Nice T-Shirt')
        except Product.DoesNotExist:
            self.fail('creating a child product did not work: %s' % page.body)
        page = product_form.submit()
 
        product = Product.objects.get(id=self.product.id)
 
        self.assertEqual(page.context['product'], self.product)

src/d/j/django-oscar-HEAD/tests/unit/partner/import_tests.py   django-oscar(Download)
    def setUp(self):
        self.importer = CatalogueImporter(logger)
        self.importer.handle(TEST_BOOKS_CSV)
        self.product = Product.objects.get(upc='9780115531446')
 
    def test_item_is_created(self):
        try:
            Product.objects.get(upc="9780115531446")
        except Product.DoesNotExist:
            self.fail()
 
        with self.assertRaises(Product.DoesNotExist):
            Product.objects.get(upc=upc)
 

src/d/j/django-oscar-HEAD/tests/integration/order/creator_tests.py   django-oscar(Download)
        place_order(self.creator, basket=self.basket, order_number='1234')
 
        product = Product.objects.get(id=product.id)
        stockrecord = product.stockrecords.all()[0]
        self.assertTrue(stockrecord.num_in_stock is None)