File: test_db_backend.py

package info (click to toggle)
python-django-postgres-extra 2.0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,096 kB
  • sloc: python: 9,057; makefile: 17; sh: 7; sql: 1
file content (12 lines) | stat: -rw-r--r-- 352 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
from django.db import connection


def test_db_backend_hstore_extension_enabled():
    """Tests whether the `hstore` extension was enabled automatically."""

    with connection.cursor() as cursor:
        cursor.execute(
            ("SELECT count(*) FROM pg_extension " "WHERE extname = 'hstore'")
        )

        assert cursor.fetchone()[0] == 1