diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2010-06-09 15:31:19 +0000 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2010-06-09 15:31:19 +0000 |
| commit | 89fb7aa31044bd3d63302b82ab31e893fa0a43a6 (patch) | |
| tree | b8c2aeadf310469532c68e49b50a7e8b2b1284fb /tests/regressiontests | |
| parent | defc4948102b01f2048eb05d51358a22183f5790 (diff) | |
[soc2010/query-refactor] Introced NativeAutoField, also started with some basic MongoDB tests (really just very basic ORM tests), and introduced various APIs into the mongodb backend that were necessary for running unittests.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/query-refactor@13338 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/mongodb/__init__.py | 0 | ||||
| -rw-r--r-- | tests/regressiontests/mongodb/models.py | 10 | ||||
| -rw-r--r-- | tests/regressiontests/mongodb/tests.py | 11 |
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/regressiontests/mongodb/__init__.py b/tests/regressiontests/mongodb/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/regressiontests/mongodb/__init__.py diff --git a/tests/regressiontests/mongodb/models.py b/tests/regressiontests/mongodb/models.py new file mode 100644 index 0000000000..e07e8f191c --- /dev/null +++ b/tests/regressiontests/mongodb/models.py @@ -0,0 +1,10 @@ +from django.db import models + + +class Artist(models.Model): + id = models.NativeAutoField(primary_key=True) + name = models.CharField(max_length=255) + good = models.BooleanField() + + def __unicode__(self): + return self.name diff --git a/tests/regressiontests/mongodb/tests.py b/tests/regressiontests/mongodb/tests.py new file mode 100644 index 0000000000..cbf0dcbcd8 --- /dev/null +++ b/tests/regressiontests/mongodb/tests.py @@ -0,0 +1,11 @@ +from django.test import TestCase + +from models import Artist + + +class MongoTestCase(TestCase): + def test_create(self): + b = Artist.objects.create(name="Bruce Springsteen", good=True) + self.assertTrue(b.pk is not None) + self.assertEqual(b.name, "Bruce Springsteen") + self.assertTrue(b.good) |
