~ubuntu-branches/ubuntu/oneiric/python-django/oneiric

« back to all changes in this revision

Viewing changes to tests/modeltests/mutually_referential/tests.py

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2011-02-17 13:34:07 UTC
  • mfrom: (1.1.13 upstream) (4.4.12 sid)
  • Revision ID: james.westby@ubuntu.com-20110217133407-rwr88elhhq6j7ba0
Tags: 1.2.5-1ubuntu1
* Merge from Debian for security fixes (LP: #719031). Remaining changes:
  - debian/control: don't Build-Depends on locales-all, which doesn't exist
    in natty
* Drop the following patches, now included upstream:
  - debian/patches/07_security_admin_infoleak.diff
  - debian/patches/08_security_pasword_reset_dos.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from django.test import TestCase
 
2
from models import Parent, Child
 
3
 
 
4
class MutuallyReferentialTests(TestCase):
 
5
 
 
6
    def test_mutually_referential(self):
 
7
        # Create a Parent
 
8
        q = Parent(name='Elizabeth')
 
9
        q.save()
 
10
 
 
11
        # Create some children
 
12
        c = q.child_set.create(name='Charles')
 
13
        e = q.child_set.create(name='Edward')
 
14
 
 
15
        # Set the best child
 
16
        # No assertion require here; if basic assignment and
 
17
        # deletion works, the test passes.
 
18
        q.bestchild = c
 
19
        q.save()
 
20
        q.delete()