diff options
author | Nishanth Amuluru | 2011-01-11 22:41:51 +0530 |
---|---|---|
committer | Nishanth Amuluru | 2011-01-11 22:41:51 +0530 |
commit | b03203c8cb991c16ac8a3d74c8c4078182d0bb48 (patch) | |
tree | 7cf13b2deacbfaaec99edb431b83ddd5ea734a52 /parts/django/tests/regressiontests/string_lookup | |
parent | 0c50203cd9eb94b819883c3110922e873f003138 (diff) | |
download | pytask-b03203c8cb991c16ac8a3d74c8c4078182d0bb48.tar.gz pytask-b03203c8cb991c16ac8a3d74c8c4078182d0bb48.tar.bz2 pytask-b03203c8cb991c16ac8a3d74c8c4078182d0bb48.zip |
removed all the buildout files
Diffstat (limited to 'parts/django/tests/regressiontests/string_lookup')
3 files changed, 0 insertions, 123 deletions
diff --git a/parts/django/tests/regressiontests/string_lookup/__init__.py b/parts/django/tests/regressiontests/string_lookup/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/parts/django/tests/regressiontests/string_lookup/__init__.py +++ /dev/null diff --git a/parts/django/tests/regressiontests/string_lookup/models.py b/parts/django/tests/regressiontests/string_lookup/models.py deleted file mode 100644 index 037854d..0000000 --- a/parts/django/tests/regressiontests/string_lookup/models.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -from django.db import models - -class Foo(models.Model): - name = models.CharField(max_length=50) - friend = models.CharField(max_length=50, blank=True) - - def __unicode__(self): - return "Foo %s" % self.name - -class Bar(models.Model): - name = models.CharField(max_length=50) - normal = models.ForeignKey(Foo, related_name='normal_foo') - fwd = models.ForeignKey("Whiz") - back = models.ForeignKey("Foo") - - def __unicode__(self): - return "Bar %s" % self.place.name - -class Whiz(models.Model): - name = models.CharField(max_length=50) - - def __unicode__(self): - return "Whiz %s" % self.name - -class Child(models.Model): - parent = models.OneToOneField('Base') - name = models.CharField(max_length=50) - - def __unicode__(self): - return "Child %s" % self.name - -class Base(models.Model): - name = models.CharField(max_length=50) - - def __unicode__(self): - return "Base %s" % self.name - -class Article(models.Model): - name = models.CharField(max_length=50) - text = models.TextField() - submitted_from = models.IPAddressField(blank=True, null=True) - - def __str__(self): - return "Article %s" % self.name diff --git a/parts/django/tests/regressiontests/string_lookup/tests.py b/parts/django/tests/regressiontests/string_lookup/tests.py deleted file mode 100644 index ddf7a8a..0000000 --- a/parts/django/tests/regressiontests/string_lookup/tests.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -from django.test import TestCase -from regressiontests.string_lookup.models import Foo, Whiz, Bar, Article, Base, Child - -class StringLookupTests(TestCase): - - def test_string_form_referencing(self): - """ - Regression test for #1661 and #1662 - - Check that string form referencing of - models works, both as pre and post reference, on all RelatedField types. - """ - - f1 = Foo(name="Foo1") - f1.save() - f2 = Foo(name="Foo2") - f2.save() - - w1 = Whiz(name="Whiz1") - w1.save() - - b1 = Bar(name="Bar1", normal=f1, fwd=w1, back=f2) - b1.save() - - self.assertEquals(b1.normal, f1) - - self.assertEquals(b1.fwd, w1) - - self.assertEquals(b1.back, f2) - - base1 = Base(name="Base1") - base1.save() - - child1 = Child(name="Child1", parent=base1) - child1.save() - - self.assertEquals(child1.parent, base1) - - def test_unicode_chars_in_queries(self): - """ - Regression tests for #3937 - - make sure we can use unicode characters in queries. - If these tests fail on MySQL, it's a problem with the test setup. - A properly configured UTF-8 database can handle this. - """ - - fx = Foo(name='Bjorn', friend=u'François') - fx.save() - self.assertEquals(Foo.objects.get(friend__contains=u'\xe7'), fx) - - # We can also do the above query using UTF-8 strings. - self.assertEquals(Foo.objects.get(friend__contains='\xc3\xa7'), fx) - - def test_queries_on_textfields(self): - """ - Regression tests for #5087 - - make sure we can perform queries on TextFields. - """ - - a = Article(name='Test', text='The quick brown fox jumps over the lazy dog.') - a.save() - self.assertEquals(Article.objects.get(text__exact='The quick brown fox jumps over the lazy dog.'), a) - - self.assertEquals(Article.objects.get(text__contains='quick brown fox'), a) - - def test_ipaddress_on_postgresql(self): - """ - Regression test for #708 - - "like" queries on IP address fields require casting to text (on PostgreSQL). - """ - a = Article(name='IP test', text='The body', submitted_from='192.0.2.100') - a.save() - self.assertEquals(repr(Article.objects.filter(submitted_from__contains='192.0.2')), - repr([a])) |