Skip to content

Commit

Permalink
new: Django 1.9 support thanks to Claude Paroz
Browse files Browse the repository at this point in the history
  • Loading branch information
acdha committed Mar 25, 2016
1 parent 816956f commit 04cc1ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ Thanks to
SearchQuerySet
* Tadas Dailyda (@skirsdeda) for various patches
* Craig de Stigter (@craigds) for a patch fixing concurrency issues when building UnifiedIndex
* Claude Paroz (@claudep) for Django 1.9 support
10 changes: 7 additions & 3 deletions test_haystack/solr_tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse

from haystack import connections, reset_search_queries
from haystack.utils.loading import UnifiedIndex
Expand All @@ -16,7 +17,7 @@

@override_settings(DEBUG=True)
class SearchModelAdminTestCase(TestCase):
fixtures = ['base_data', 'bulk_data.json']
fixtures = ['base_data.json', 'bulk_data.json']

def setUp(self):
super(SearchModelAdminTestCase, self).setUp()
Expand Down Expand Up @@ -70,7 +71,10 @@ def test_usage(self):
self.assertIn(5, result_pks)

# Make sure only changelist is affected.
resp = self.client.get('/admin/core/mockmodel/1/')
resp = self.client.get(reverse('admin:core_mockmodel_change', args=(1, )))
self.assertEqual(resp.status_code, 200)
self.assertEqual(len(connections['solr'].queries), 3)
self.assertEqual(resp.context['original'].id, 1)
self.assertTemplateUsed(resp, 'admin/change_form.html')

# The Solr query count should be unchanged:
self.assertEqual(len(connections['solr'].queries), 3)

0 comments on commit 04cc1ab

Please sign in to comment.