Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

v0.6.rst 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. =======================
  2. Oscar 0.6 release notes
  3. =======================
  4. Welcome to Oscar 0.6!
  5. These release notes cover the `new features`_ as well as `backwards incompatible changes`_
  6. that you'll want to be aware of when upgrading from Oscar 0.5 or
  7. earlier. This release contains some major changes to core APIs which means
  8. many old APIs are to be dropped - see the `deprecation plan`_.
  9. To upgrade your Oscar site, make sure you study both the `backwards incompatible changes`_
  10. and the `deprecated features`_
  11. .. _`new features`: `What's new in Oscar 0.6?`_
  12. .. _`upgrading advice`: `Upgrading notes`_
  13. .. _`deprecation plan`: `Features deprecated in 0.6`_
  14. .. _`deprecated features`: `Features deprecated in 0.6`_
  15. .. _`backwards incompatible changes`: `Backwards incompatible changes in 0.6`_
  16. Overview
  17. ========
  18. The biggest change in Oscar 0.6 is the reworking of `pricing and availability`_, which
  19. builds on top of the change to allow `multiple stockrecords per product`_. The
  20. charge is largely backwards compatible with the old system of "partner
  21. wrappers" but it is recommended to upgrade to the new system. Support for
  22. partner wrappers will be removed for Oscar 0.7.
  23. Oscar 0.6 also introduces better support for marketplaces with the so-called
  24. permission-based dashboard. It is now possible to give non-staff users access
  25. to a subset of the dashboard's views (products and orders) by setting the
  26. new ``dashboard_access`` permission.
  27. `Oscar now supports Django 1.5`_ and its custom user model. This has been only
  28. tested in the context of starting a new Oscar project with a custom model.
  29. Switching from a separate "profile" model to the new system is not recommended
  30. at this point.
  31. Other notable new features include:
  32. * A feature-rich `demo site`_ that illustrates how Oscar can be customised. It
  33. uses several of Oscar's many extensions, such as django-oscar-paypal_,
  34. django-oscar-datacash_ and django-oscar-stores_. It is intended as a
  35. reference site for Oscar.
  36. * `Partners can now have addresses`_.
  37. * `Customer wishlists`_
  38. * `New helper methods`_ in the ``EventHandler`` class for order processing
  39. .. _`Oscar now supports Django 1.5`: `Django 1.5 and custom user model support`_
  40. .. _`Partners can now have addresses`: `Partner addresses`_
  41. .. _`Customer wishlists`: `Wishlists`_
  42. .. _`New helper methods`: `Order processing changes`_
  43. What's new in Oscar 0.6?
  44. ========================
  45. Multiple stockrecords per product
  46. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  47. Products can now have multiple stockrecords rather than just one. This allows a
  48. product to be fulfilled by one of several partners. This is a key requirement
  49. for large-scale e-commerce sites selling millions of products, that use many
  50. different fulfillment partners. It also allows products to be sold in
  51. different currencies.
  52. This changes means several APIs are `deprecated`_ as they assume there is only
  53. one stockrecord per product.
  54. .. _`deprecated`: `Features deprecated in 0.6`_
  55. Pricing and availability
  56. ~~~~~~~~~~~~~~~~~~~~~~~~
  57. When products can have many stockrecords, a process needs to be in place to
  58. choose which one is selected for a given customer and product. To handle this,
  59. a new "strategy" class has been introduced which selects the appropriate
  60. stockrecord for a given customer and product.
  61. This change also paved the way for reworking how prices, taxes and availability
  62. are handled. Instead of using `"partner wrappers"`_, the strategy class is
  63. responsible for returning availability details and prices for a particular
  64. product. New classes known as pricing and availabiliy policies are used to
  65. encapsulate this information.
  66. These changes allows Oscar to dynamically choose which stockrecord to use for a
  67. given customer and product. This enables several advanced features such as:
  68. * Fulfilling a product from the partner that offers the best margin.
  69. * Fulfilling a product from the partner geographically closest to the customer.
  70. * Supporting transactions in multiple currencies on the same site.
  71. * Supporting different tax treatments on the same site (eg UK VAT and US sales
  72. tax)
  73. * Having different pricing policies for different customers.
  74. It also provides a customisation layer for custom price and availability logic.
  75. There's a great deal of flexibility. See the guide to
  76. :doc:`prices and availability </topics/prices_and_availability>`
  77. for more information.
  78. Note that the :func:`oscar.templatetags.currency_filters.currency` now
  79. accepts an optional currency parameter.
  80. Permission-based dashboard
  81. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  82. Three changes were necessary to better support marketplace scenarios within
  83. Oscar:
  84. * Oscar's core :class:`oscar.core.application.Application` class now supports
  85. specifying permissions on a per-view basis. This is done via a new default
  86. decorator. Legacy behaviour is unchanged.
  87. * The dashboard's menu's are now built dynamically. If the current user does
  88. not have access to some views in :ref:`OSCAR_DASHBOARD_NAVIGATION`, they will
  89. be omitted in the menu returned by
  90. :meth:`oscar.apps.dashboard.nav.create_menu`.
  91. * The index, catalogue and order dashboard views have been modified to allow
  92. access to non-staff users. See :doc:`/ref/apps/dashboard` for details.
  93. Payment models have abstract versions
  94. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  95. The :doc:`payment models </ref/apps/payment>` have been split into abstract- and
  96. concrete versions. This brings them inline with other Oscar apps and allows
  97. them to be customised.
  98. Wishlists
  99. ~~~~~~~~~
  100. Wishlist functionality has finally landed. Signed in customers are now able to
  101. create multiple named wishlists and add products to them. There is a new
  102. section in the customer's account where wishlists can be managed.
  103. Partner addresses
  104. ~~~~~~~~~~~~~~~~~
  105. Partners can now have addresses. These are useful for US sales tax where tax
  106. calculations need to know the origin of a product being shipped. The dashboard
  107. has been extended to allow partner addresses to be edited.
  108. Checkout
  109. ~~~~~~~~
  110. The :class:`~oscar.apps.checkout.views.PaymentDetailsView` checkout view has
  111. been restructured slightly to be more flexible. There is a new
  112. ``build_submission`` method which is responsible for building a dict of all data
  113. for passing to the ``submit`` method. This includes the shipping address and
  114. shipping method which were previously loaded indirectly within the ``submit``
  115. method. The ``submit`` method has also been extended to take additional parameters.
  116. Demo site
  117. ~~~~~~~~~
  118. Oscar now ships with a demo site along side the sandbox site. While the sandbox
  119. is a minimal Django project that uses Oscar with all its defaults, the demo site
  120. is a more realistic example of an Oscar project. It has a custom skin and makes
  121. many alterations to the default Oscar behaviour.
  122. It's features include:
  123. * A range of different product types: books, downloads, clothing
  124. * PayPal Express integration using django-oscar-paypal_
  125. * Datacash integration using django-oscar-datacash_
  126. .. _django-oscar-paypal: https://github.com/tangentlabs/django-oscar-paypal
  127. .. _django-oscar-datacash: https://github.com/tangentlabs/django-oscar-datacash
  128. .. _django-oscar-stores: https://github.com/tangentlabs/django-oscar-stores
  129. Further reading:
  130. * :doc:`The demo site </internals/sandbox>`.
  131. Django 1.5 and custom user model support
  132. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  133. Oscar now supports `custom user models`_, the headline new feature in Django
  134. 1.5. These can be used standalone or with a one-to-one profile model: Oscar's
  135. account forms inspect the model fields to dynamically pick up the fields for
  136. editing and display.
  137. There are some restrictions on what fields a custom user model must have. For
  138. instance, Oscar's default auth backend requires the user model to have an email
  139. and password field. New Oscar projects are encouraged to use the provided
  140. abstract user model as the base for their users.
  141. Further reading:
  142. * :doc:`How to use a custom user model </howto/use_a_custom_user_model>`.
  143. .. _`custom user models`: https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model
  144. .. _`documentation on user models`: https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model
  145. Accounts
  146. ~~~~~~~~
  147. The views and templates of the accounts section have been reworked to be clearer
  148. and easier to extend.
  149. Bootstrap-WYSIHTML5 replaced by TinyMCE
  150. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  151. TinyMCE 4.0 is now used in the dashboard for all textareas with class
  152. ``wysiwyg``. This has better browser support and is easier to customise than
  153. bootstrap-wysihtml5.
  154. It is easy to configure or replace with the HTML editor of your choice.
  155. Better bankcard handling
  156. ~~~~~~~~~~~~~~~~~~~~~~~~
  157. The bankcard model in the payment app has been greatly improved.
  158. Customer-facing range pages
  159. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  160. Ranges can now be flagged as public which means they can be browsed by
  161. customers. They can be used to created curated collections of products.
  162. The core :class:`~oscar.apps.offer.models.Range` model has been extended with a
  163. HTML description field also.
  164. Order processing changes
  165. ~~~~~~~~~~~~~~~~~~~~~~~~
  166. There are changes to order processing methods
  167. Minor changes
  168. ~~~~~~~~~~~~~
  169. * detox_ is a new dependency, which allows running `tox` tests in parallel.
  170. .. _detox: https://pypi.python.org/pypi/detox
  171. Backwards incompatible changes in 0.6
  172. =====================================
  173. Checkout
  174. ~~~~~~~~
  175. Several changes have been made to the checkout classes.
  176. * The ``submit`` method in
  177. :class:`~oscar.apps.checkout.views.PaymentDetailsView` now accepts several
  178. new parameters.
  179. * The ``handle_payment`` method in
  180. :class:`~oscar.apps.checkout.views.PaymentDetailsView` now accepts a
  181. :class:`~oscar.core.prices.Price`` instance instead of a Decimal.
  182. Signature changes
  183. ~~~~~~~~~~~~~~~~~
  184. Several classes and functions have had signature changes:
  185. * The ``basket_form`` templatetag has been altered to take the ``request`` as the
  186. first argument, not ``request.basket``.
  187. * The :class:`oscar.apps.customer.forms.EmailAuthenticationForm` form needs to
  188. be instantated with a host name so prevent redirects to external sites.
  189. * The :class:`oscar.apps.customer.forms.EmailAuthenticationForm` form needs to
  190. be instantated with a host name so prevent redirects to external sites.
  191. * The two product review forms, ``SignedInUserProductReviewForm`` and
  192. ``AnonymousUserProductReviewForm``, have been replaced by a new
  193. :class:`oscar.apps.catalogue.reviews.forms.ProductReviewForm``.
  194. Loading shipping methods
  195. ~~~~~~~~~~~~~~~~~~~~~~~~
  196. The default implementation of the shipping method repository has been adjusted
  197. to avoid thread-safety issues. If you define your own shipping ``Repository``
  198. class, ensure that your shipping methods are instantiated per-request and not
  199. at compile time.
  200. For example, avoid this:
  201. .. code-block:: python
  202. from oscar.apps.shipping import repository
  203. class Repository(repository.Repository)
  204. methods = [SomeMethod(), AnotherMethod()]
  205. Instead, instantiate the methods within ``get_shipping_methods``:
  206. .. code-block:: python
  207. from oscar.apps.shipping import repository
  208. class Repository(repository.Repository)
  209. # Note, methods are not instantiated
  210. methods = [SomeMethod, AnotherMethod]
  211. Beware of shipping methods that are configured via constructor arguments, like
  212. :class:`~oscar.apps.shipping.methods.FixedPrice`. Shipping methods will be
  213. reworked for Oscar 0.7.
  214. Basket model changes
  215. ~~~~~~~~~~~~~~~~~~~~~
  216. Several properties of the basket ``Line`` model have been renamed:
  217. * ``Line.line_price_excl_tax_and_discounts`` has been renamed to
  218. ``Line.line_price_exlc_tax_incl_discounts``.
  219. * ``Line.line_price_incl_tax_and_discounts`` has been renamed to
  220. ``Line.line_price_inlc_tax_incl_discounts``.
  221. Address model changes
  222. ~~~~~~~~~~~~~~~~~~~~~
  223. * The ``UserAddress.salutation`` and ``UserAddress.name`` methods are now
  224. properties.
  225. * The ``Country`` model's `is_highlighted` column is now an integer field to allow
  226. fine-grained country selection.
  227. Renamed templates
  228. ~~~~~~~~~~~~~~~~~
  229. Some templates have been renamed for greater consistency. If you are overriding
  230. these templates, ensure you rename your corresponding project templates.
  231. Many of the profile templates have been reorganised:
  232. * ``customer/address_list.html`` is renamed to
  233. ``customer/address/address_list.html``
  234. * ``customer/address_form.html`` is renamed to
  235. ``customer/address/address_form.html``
  236. * ``customer/address_delete.html`` is renamed to
  237. ``customer/address/address_delete.html``
  238. * ``customer/email.html`` is renamed to
  239. ``customer/email/email_detail.html``
  240. * ``customer/email_list.html`` is renamed to
  241. ``customer/email/email_list.html``
  242. * ``customer/order.html`` is renamed to
  243. ``customer/order/order_detail.html``
  244. * ``customer/order_list.html`` is renamed to
  245. ``customer/order/order_list.html``
  246. * ``customer/profile.html`` is renamed to
  247. ``customer/profile/profile.html``
  248. * ``customer/profile_form.html`` is renamed to
  249. ``customer/profile/profile_form.html``
  250. * ``customer/change_password_form.html`` is renamed to
  251. ``customer/profile/change_password_form.html``
  252. * ``partials/nav_profile.html`` has been removed.
  253. Template block changes
  254. ~~~~~~~~~~~~~~~~~~~~~~
  255. * The template ``dashboard/orders/order_detail.html`` has been reorganised. The
  256. ``tab_transactions`` block has been renamed to ``payment_transactions``.
  257. * In ``checkout/checkout.html``, the ``checkout-nav`` block has been renamed
  258. ``checkout_nav``.
  259. Account templates
  260. ~~~~~~~~~~~~~~~~~
  261. The templates for the customer account section have been reworked so that the
  262. profile page is much simpler. Content is no longer loaded into tabs on a single
  263. page; instead, separate pages are used to each section.
  264. Additional apps
  265. ~~~~~~~~~~~~~~~
  266. To enable dynamic loading of dashboard `Application` classes, two new apps are required
  267. in your ``INSTALLED_APPS``:
  268. .. code-block:: python
  269. INSTALLED_APPS = (
  270. ...
  271. 'oscar.apps.dashboard.pages',
  272. 'oscar.apps.dashboard.reviews',
  273. ...
  274. )
  275. If you are using the ``get_core_apps`` helper function, then these new apps
  276. will be added automatically. Neither of these apps contains models so no
  277. database schema changes are required.
  278. Changes to Partner permissions
  279. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  280. The following permissions on the
  281. :class:`~oscar.apps.partner.abstract_models.AbstractPartner` model were not
  282. used in Oscar and have been removed to avoid confusion with the newly
  283. introduced permission-based dashboard:
  284. * ``can_edit_stock_records``
  285. * ``can_view_stock_records``
  286. * ``can_edit_product_range``
  287. * ``can_view_product_range``
  288. * ``can_edit_order_lines``
  289. * ``can_view_order_lines``
  290. The permission-based dashboard introduced a new permission:
  291. * ``dashboard_access``
  292. Upgrading notes
  293. ===============
  294. * Alternative product class templates now use ``slug` field instead of
  295. ``name.lower()`` to determine their filename. If you have templates for
  296. specific product classes, please update your filenames accordingly
  297. Checkout app:
  298. * Checkout has a new option "Register and continue". Option value `new` in
  299. `GatewayForm` has changed to `guest` as `new` option is used for this feature.
  300. * Payment details - create_billing_address accepts kwargs so data can be passed
  301. to it from the final page of checkout.
  302. * The session methods for loading shipping addresses and methods have been made
  303. explicit. The relevant basket *has* to be passed in now.
  304. Payment app:
  305. * The `balance` method on the source object is not a property not a method.
  306. URLs
  307. ~~~~
  308. Migrations
  309. ~~~~~~~~~~
  310. There are new migrations in the following apps to be aware of.
  311. * Catalogue:
  312. - ``0011``: Higher ``max_length`` on FileFields and ImageFields
  313. * Promotions:
  314. - ``0003``: Higher ``max_length`` on FileFields and ImageFields
  315. * Address:
  316. - ``0003``: ``Country``'s ``is_highlighted`` is now an integer to allow
  317. finer control.
  318. * ShippingAddress:
  319. - ``0018``: ``ShippingAddress``'s ``phone_number`` is now a PhoneNumberField
  320. to allow fine validation.
  321. * Order app:
  322. - The `date` field of the ``order.AbstractCommunicationEvent``, ``order.AbstractPaymentEvent`` and
  323. ``order.AbstractShippingEvent`` models have been renamed to ``date_created`` for
  324. consistency with the rest of Oscar.
  325. Order app:
  326. * ``0015``: Unused ``sequence_number`` and ``is_required`` deleted from
  327. ``ShippingEventType``. Unused ``sequence_number`` deleted from
  328. ``PaymentEventType``.
  329. Offer app:
  330. * ``0021``: Add a ``slug`` field to the :class:`~oscar.apps.offer.models.Range` model.
  331. * ``0022``: A data migration to populate the new range slug field.
  332. * ``0023``: Add a ``is_public`` field to the :class:`~oscar.apps.offer.models.Range` model.
  333. * ``0024``: Add a ``description`` field to the :class:`~oscar.apps.offer.models.Range` model.
  334. Features deprecated in 0.6
  335. ==========================
  336. Accessing a product's stockrecords
  337. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  338. Several properties and methods of the core
  339. :class:`~oscar.apps.catalogue.abstract_models.AbstractProduct` class have been
  340. deprecated following the change to allow multiple stockrecords per product.
  341. * :attr:`~oscar.apps.catalogue.abstract_models.AbstractProduct.has_stockrecord`
  342. no longer makes sense when there can be more than one stockrecord. It is
  343. replaced by
  344. :attr:`~oscar.apps.catalogue.abstract_models.AbstractProduct.has_stockrecords`
  345. * :attr:`~oscar.apps.catalogue.abstract_models.AbstractProduct.stockrecord` is
  346. deprecated since it presumes there is only one stockrecord per product.
  347. Choosing the appropriate stockrecord is now the responsiblity of the
  348. :ref:`strategy class <strategy_class>`. A backward compatible version has
  349. been kept in place that selects the first stockrecord for a product. This
  350. will continue to work for sites that only have one stockrecord per product.
  351. All availability logic has been moved to :ref:`availability policies<availability_policies>`
  352. which are determined by the :ref:`strategy class <strategy_class>`.
  353. * :attr:`~oscar.apps.catalogue.abstract_models.AbstractProduct.is_available_to_buy`
  354. is deprecated. The functionality is now part of availability policies.
  355. * :meth:`~oscar.apps.catalogue.abstract_models.AbstractProduct.is_purchase_permitted`
  356. is deprecated. The functionality is now part of availability policies.
  357. Checkout session manager
  358. ~~~~~~~~~~~~~~~~~~~~~~~~
  359. The ``shipping_method`` method of the
  360. :class:`~oscar.apps.checkout.utils.CheckoutSessionData` is now deprecated in
  361. favour of using ``shipping_method_code``. It is being removed as the
  362. ``CheckoutSessionData`` class should only be responsible for retriving data
  363. from the session, not loading shipping method instances.
  364. "Partner wrappers"
  365. ~~~~~~~~~~~~~~~~~~
  366. Before Oscar 0.6, availability and pricing logic was encapsulated in "partner
  367. wrappers". A partner wrapper was a class that provided availability and price
  368. information for a particular partner, as specified by the
  369. ``OSCAR_PARTNER_WRAPPERS`` setting. The stockrecord model had several
  370. properties and methods
  371. which delegated to the appropriate wrapper for the record's partner.
  372. This functionailty is now deprecated in favour of using :ref:`strategy classes <strategy_class>`.
  373. How prices and taxes are determined is not generally a function of the partner,
  374. and so this system was not a good model. Strategy classes are much more
  375. flexible and allow better modelling of taxes and availability.
  376. The following attributes and methods from :class:`~oscar.apps.partner.abstract_models.StockRecord`
  377. are deprecated and will be removed for Oscar 0.7.
  378. * :attr:`AbstractStockRecord.is_available_to_buy <oscar.apps.partner.abstract_models.AbstractStockRecord.is_available_to_buy>`
  379. * :meth:`AbstractStockRecord.is_purchase_permitted <oscar.apps.partner.abstract_models.AbstractStockRecord.is_purchase_permitted>`
  380. * :attr:`AbstractStockRecord.availability_code <oscar.apps.partner.abstract_models.AbstractStockRecord.availability_code>`
  381. * :attr:`AbstractStockRecord.availability <oscar.apps.partner.abstract_models.AbstractStockRecord.availability>`
  382. * :attr:`AbstractStockRecord.max_purchase_quantity <oscar.apps.partner.abstract_models.AbstractStockRecord.max_purchase_quantity>`
  383. * :attr:`AbstractStockRecord.dispatch_date <oscar.apps.partner.abstract_models.AbstractStockRecord.dispatch_date>`
  384. * :attr:`AbstractStockRecord.lead_time <oscar.apps.partner.abstract_models.AbstractStockRecord.lead_time>`
  385. * :attr:`AbstractStockRecord.price_incl_tax <oscar.apps.partner.abstract_models.AbstractStockRecord.price_incl_tax>`
  386. * :attr:`AbstractStockRecord.price_tax <oscar.apps.partner.abstract_models.AbstractStockRecord.price_tax>`
  387. All the above properties and methods have effectively been moved to the availability and pricing
  388. policies that a strategy class is responsible for loading. To upgrade your
  389. codebase, replcae your partner wrapper classes with equivalent
  390. :doc:`availability and pricing policies </topics/prices_and_availability>`.
  391. Basket
  392. ~~~~~~~
  393. Now that products can have multiple stockrecords, several changes have been made
  394. to baskets to allow the appropriate stockrecord to be tracked for each basket
  395. line. The basket line model has a new field that links to the selected
  396. stockrecord and the basket itself requires an instance of the strategy class so
  397. that prices can be calculated for each line. Hence, if you are manipulating
  398. baskets directly, you need to assign a strategy class in order for prices to
  399. calculate correctly:
  400. .. code-block:: python
  401. from oscar.apps.basket import models
  402. basket = models.Basket.objects.get(id=1)
  403. basket.strategy = request.strategy
  404. With an assigned strategy class, a basket will raise a ``RuntimeError`` when
  405. attempting to calculate totals.
  406. The way a product is added to a basket has also been changed as a ``StockInfo``
  407. instance is also required.
  408. .. code-block:: python
  409. from oscar.apps.basket import models
  410. from oscar.apps.catalogue import models as product_models
  411. basket = models.Basket.objects.get(id=1)
  412. basket.strategy = request.strategy
  413. product = product_models.Product.objects.get(id=1)
  414. stockinfo = request.strategy.fetch(product)
  415. basket.
  416. Test support extension brought back into core
  417. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  418. The `Oscar test support library`_ has been ported back into Oscar core. This
  419. simplifies things and avoids circular dependency issues. If your project is
  420. using this extension, you should remove it as a dependency and use the
  421. analogous functionality from ``oscar/test/``.
  422. .. _`Oscar test support library`: https://github.com/tangentlabs/django-oscar-testsupport