-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
115 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
"""JQuery-Ajax Autocomplete fields for Django Forms.""" | ||
__version__ = "1.6.0" | ||
__version__ = "1.6.1" | ||
__author__ = "crucialfelix" | ||
__contact__ = "[email protected]" | ||
__homepage__ = "https://github.com/crucialfelix/django-ajax-selects/" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,23 +9,23 @@ | |
|
||
setup( | ||
name='django-ajax-selects', | ||
version='1.6.0', | ||
version='1.6.1', | ||
description='Edit ForeignKey, ManyToManyField and CharField in Django Admin using jQuery UI AutoComplete.', | ||
author='Chris Sattinger', | ||
author_email='[email protected]', | ||
url='https://github.com/crucialfelix/django-ajax-selects/', | ||
packages=['ajax_select'], | ||
package_data={'ajax_select': | ||
[ | ||
'*.py', | ||
'*.txt', | ||
'*.md', | ||
'static/ajax_select/css/*', | ||
'static/ajax_select/images/*', | ||
'static/ajax_select/js/*', | ||
'templates/ajax_select/*.html' | ||
] | ||
}, | ||
[ | ||
'*.py', | ||
'*.txt', | ||
'*.md', | ||
'static/ajax_select/css/*', | ||
'static/ajax_select/images/*', | ||
'static/ajax_select/js/*', | ||
'templates/ajax_select/*.html' | ||
] | ||
}, | ||
include_package_data=True, | ||
zip_safe=False, | ||
license="MIT", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,38 @@ | ||
|
||
from django.test import TestCase | ||
from django.contrib.auth.models import User | ||
from .lookups import UserLookup | ||
from django.test import TestCase | ||
|
||
from tests.lookups import PersonWithTitleLookup, UserLookup | ||
from tests.models import PersonWithTitle | ||
|
||
|
||
class TestLookups(TestCase): | ||
|
||
def test_get_objects(self): | ||
user1 = User.objects.create(username='user1', | ||
email='[email protected]', | ||
password='password') | ||
email='[email protected]', | ||
password='password') | ||
user2 = User.objects.create(username='user2', | ||
email='[email protected]', | ||
password='password') | ||
email='[email protected]', | ||
password='password') | ||
lookup = UserLookup() | ||
# deliberately asking for them backwards: | ||
users = lookup.get_objects([user2.id, user1.id]) | ||
self.assertEqual(len(users), 2) | ||
# to make sure they come back in the order requested | ||
u2, u1 = users | ||
self.assertEqual(u1, user1) | ||
self.assertEqual(u2, user2) | ||
|
||
def test_get_objects_inherited_model(self): | ||
""" | ||
Tests that get_objects works with inherited models | ||
""" | ||
one = PersonWithTitle.objects.create(name='one', title='The One') | ||
two = PersonWithTitle.objects.create(name='two', title='The Other') | ||
lookup = PersonWithTitleLookup() | ||
users = lookup.get_objects([one.id, two.id]) | ||
self.assertEqual(len(users), 2) | ||
u1, u2 = users | ||
self.assertEqual(u1, one) | ||
self.assertEqual(u2, two) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters