'Regression test for the use of None as a query value.
None is interpreted as an SQL NULL, but only in __exact queries.
Set up some initial polls and choices'

def test_none_as_null(self):

    p1 = Poll(question='Why?')
    p1.save()
    c1 = Choice(poll=p1, choice='Because.')
    c1.save()
    c2 = Choice(poll=p1, choice='Why    Not?')
    c2.save()
    self.assertQuerysetEqual(Choice.objects.filter(choice__exact=None), [])
    self.assertQuerysetEqual(Choice.objects.exclude(choice=None).order_by('id'), ['<Choice:    Choice:    Because.    in    poll    Q:    Why?    >', '<Choice:    Choice:    Why    Not?    in    poll    Q:    Why?    >'])
    self.assertRaises(FieldError, Choice.objects.filter, foo__exact=None)
    self.assertRaises(ValueError, Choice.objects.filter, id__gt=None)
    self.assertRaises(ValueError, Choice.objects.filter, foo__gt=None)
    p2 = Poll(question='How?')
    self.assertEquals(repr(p2.choice_set.all()), '[]')
