Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Commit

Permalink
Add SearchIndexTests.
Browse files Browse the repository at this point in the history
  • Loading branch information
toolness committed Mar 22, 2018
1 parent 192946d commit 9c9d3d8
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions contracts/tests/test_contract.py
Expand Up @@ -3,6 +3,7 @@
from decimal import Decimal
from itertools import cycle

from django.db import connection
from django.test import TestCase, SimpleTestCase
from contracts.mommy_recipes import get_contract_recipe

Expand Down Expand Up @@ -441,3 +442,23 @@ def test_search_for_jr_finds_junior(self):
'Jr. Language Interpreter',
'Junior Language Interpreter',
])


class SearchIndexTests(TestCase):
GET_SCHEMA_SQL = """
SELECT column_name, data_type, column_default, is_nullable
FROM information_schema.columns
WHERE table_name = 'contracts_contract'
AND column_name = 'search_index'
"""

def test_schema_is_what_we_expect(self):
with connection.cursor() as cursor:
cursor.execute(self.GET_SCHEMA_SQL)
row = cursor.fetchone()
self.assertEqual(row, (
'search_index',
'tsvector',
None,
'YES',
))

0 comments on commit 9c9d3d8

Please sign in to comment.