Browse Source

Refactored test_helpers into test.helpers package

master
David Winterbottom 15 years ago
parent
commit
e3fa1d77ee
5 changed files with 4 additions and 18 deletions
  1. 1
    1
      oscar/customer/tests.py
  2. 1
    1
      oscar/discount/tests.py
  3. 1
    1
      oscar/offer/tests.py
  4. 1
    1
      oscar/shipping/tests.py
  5. 0
    14
      oscar/test_helpers.py

+ 1
- 1
oscar/customer/tests.py View File

@@ -4,7 +4,7 @@ from django.core.urlresolvers import reverse
4 4
 from django.http import HttpRequest
5 5
 
6 6
 from oscar.customer.history_helpers import get_recently_viewed_product_ids
7
-from oscar.test_helpers import create_product
7
+from oscar.test.helpers import create_product
8 8
 
9 9
 class HistoryHelpersTest(unittest.TestCase):
10 10
     

+ 1
- 1
oscar/discount/tests.py View File

@@ -3,7 +3,7 @@ import datetime
3 3
 
4 4
 from django.utils import unittest
5 5
 
6
-from oscar.test_helpers import create_product
6
+from oscar.test.helpers import create_product
7 7
 from oscar.discount.models import DiscountOffer, PERCENTAGE_DISCOUNT, ABSOLUTE_DISCOUNT, FINAL_PRICE 
8 8
 
9 9
 

+ 1
- 1
oscar/offer/tests.py View File

@@ -8,7 +8,7 @@ from oscar.offer.models import *
8 8
 from oscar.basket.models import Basket
9 9
 from oscar.product.models import Item, ItemClass
10 10
 from oscar.stock.models import Partner, StockRecord
11
-from oscar.test_helpers import create_product
11
+from oscar.test.helpers import create_product
12 12
 
13 13
 
14 14
 class RangeTest(unittest.TestCase):

+ 1
- 1
oscar/shipping/tests.py View File

@@ -6,7 +6,7 @@ from django.test.client import Client
6 6
 from oscar.shipping.methods import FreeShipping, FixedPriceShipping
7 7
 from oscar.shipping.models import OrderAndItemLevelChargeMethod
8 8
 from oscar.basket.models import Basket
9
-from oscar.test_helpers import create_product
9
+from oscar.test.helpers import create_product
10 10
 
11 11
 class FreeShippingTest(unittest.TestCase):
12 12
     

+ 0
- 14
oscar/test_helpers.py View File

@@ -1,14 +0,0 @@
1
-from oscar.product.models import ItemClass, Item
2
-from oscar.stock.models import Partner, StockRecord
3
-
4
-def create_product(price=None):
5
-    u"""
6
-    Helper method for creating products that are used in 
7
-    tests.
8
-    """
9
-    ic,_ = ItemClass._default_manager.get_or_create(name="Dummy item class")
10
-    item = Item._default_manager.create(title="Dummy product", item_class=ic)
11
-    if price:
12
-        partner,_ = Partner._default_manager.get_or_create(name="Dummy partner")
13
-        sr = StockRecord._default_manager.create(product=item, partner=partner, price_excl_tax=price)
14
-    return item

Loading…
Cancel
Save