Matthew Schinckel avatar Matthew Schinckel committed 994f19d

Removed support for really, really old django versions.
Make it easier to test against postgres.

Comments (0)

Files changed (2)

 Remove support for storing data using Postgres' 9.2's JSON data type, as
 you cannot currently query against this!
+Remove support for django < 1.3.
 BASE_PATH = os.path.dirname(__file__) + 'jsonfield/'
-def main():
+def main(db_engine='sqlite3'):
     Standalone django model test with a 'memory-only-django-installation'.
     You can play with a django model without a complete django app installation.
     global_settings.DATABASES = {
         'default': {
-            'ENGINE': 'django.db.backends.sqlite3',
-            'NAME': ':memory:',
+            'ENGINE': 'django.db.backends.%s' % db_engine,
+            'NAME': 'django-jsonfield',
-    }
-    # Django 1.1 compat
-    global_settings.DATABASE_ENGINE = "sqlite3"
-    global_settings.DATABASE_NAME = ":memory:"
+    } 
     global_settings.STATIC_URL = "/static/"
     global_settings.MEDIA_ROOT = os.path.join(BASE_PATH, 'static')
     from django.test.utils import get_runner
     test_runner = get_runner(global_settings)
-    if django.VERSION > (1,2):
-        test_runner = test_runner()
-        failures = test_runner.run_tests(['jsonfield'])
-    else:
-        failures = test_runner(['jsonfield'], verbosity=1)
+    test_runner = test_runner()
+    failures = test_runner.run_tests(['jsonfield'])
+def test_postgres():
+    main('postgresql_psycopg2')
 if __name__ == '__main__':
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.