djangonauts / django-pgjson

PostgreSQL json field support for Django
http://djangonauts.github.io/django-pgjson/
Other
131 stars 39 forks source link

Can't run tests on postgres 9.3.6 #15

Closed LilyFoote closed 9 years ago

LilyFoote commented 9 years ago

I get:

RuntimeError: django_pgjson: PostgreSQL >= 9.4 is required for jsonb support.

It would be useful if the JsonBField tests are skipped on postgres 9.2 and 9.3.

Full traceback:

$ python runtests.py 
Creating test database for alias 'default'...
Traceback (most recent call last):
  File "runtests.py", line 16, in <module>
    execute_from_command_line(args)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/core/management/commands/test.py", line 50, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/core/management/commands/test.py", line 71, in execute
    super(Command, self).execute(*args, **options)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/core/management/commands/test.py", line 88, in handle
    failures = test_runner.run_tests(test_labels)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/test/runner.py", line 147, in run_tests
    old_config = self.setup_databases()
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/test/runner.py", line 109, in setup_databases
    return setup_databases(self.verbosity, self.interactive, **kwargs)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/test/runner.py", line 299, in setup_databases
    serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE", True),
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/db/backends/creation.py", line 377, in create_test_db
    test_flush=True,
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/core/management/__init__.py", line 115, in call_command
    return klass.execute(*args, **defaults)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/core/management/commands/migrate.py", line 161, in handle
    executor.migrate(targets, plan, fake=options.get("fake", False))
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/db/migrations/executor.py", line 68, in migrate
    self.apply_migration(migration, fake=fake)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/db/migrations/executor.py", line 102, in apply_migration
    migration.apply(project_state, schema_editor)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/db/migrations/migration.py", line 108, in apply
    operation.database_forwards(self.app_label, schema_editor, project_state, new_state)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/db/migrations/operations/models.py", line 36, in database_forwards
    schema_editor.create_model(model)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/db/backends/schema.py", line 213, in create_model
    definition, extra_params = self.column_sql(model, field)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/db/backends/schema.py", line 116, in column_sql
    db_params = field.db_parameters(connection=self.connection)
  File "/home/ian/.virtualenvs/django-pgjson/lib/python3.4/site-packages/django/db/models/fields/__init__.py", line 548, in db_parameters
    type_string = self.db_type(connection)
  File "/home/ian/work/django-pgjson/django_pgjson/fields.py", line 88, in db_type
    raise RuntimeError("django_pgjson: PostgreSQL >= 9.4 is required for jsonb support.")
RuntimeError: django_pgjson: PostgreSQL >= 9.4 is required for jsonb support.
niwinz commented 9 years ago

Thanks for the suggestion, but currently is not a priority. Obviously, PR are welcome!