Ticket #5063: tests.py

File tests.py, 825 bytes (added by John Shaffer <jshaffer2112@…>, 17 years ago)

The tests that expose the problem.

Line 
1r"""
2>>> from testapp.models import *
3
4>>> colors = OptionGroup.objects.create(name="colors")
5>>> sizes = OptionGroup.objects.create(name="sizes")
6>>> shirt = Product.objects.create(name="shirt")
7>>> config = ConfigurableProduct(product="shirt")
8>>> config.option_groups.add(colors)
9>>> config.option_groups.add(sizes)
10>>> config.option_groups.order_by('name')
11[<OptionGroup: colors>, <OptionGroup: sizes>]
12"""
13
14# Use this to reproduce the error from a Python shell
15_ = """
16from testapp.models import *
17
18colors = OptionGroup.objects.create(name="colors")
19sizes = OptionGroup.objects.create(name="sizes")
20shirt = Product.objects.create(name="shirt")
21config = ConfigurableProduct(product=shirt)
22config.option_groups.add(colors)
23config.option_groups.add(sizes)
24config.option_groups.order_by('name')
25"""
Back to Top