Ticket 20234 20236 #1116

Merged
merged 1 commit into from May 19, 2013

Conversation

Projects
None yet
2 participants

@mjtamlyn mjtamlyn commented on an outdated diff May 18, 2013

tests/generic_views/test_base.py
@@ -431,3 +444,6 @@ def test_overwrite_queryset(self):
# Overwrite the view's queryset with queryset from kwarg
context = test_view.get_context_data(object_list=queryset)
self.assertEqual(context['object_list'], queryset)
+
+
@mjtamlyn

mjtamlyn May 18, 2013

Member

We need to remove these blank lines which were added

@mjtamlyn mjtamlyn commented on an outdated diff May 18, 2013

tests/generic_views/test_base.py
@@ -412,6 +412,19 @@ def test_get_context_data_super(self):
context = test_view.get_context_data(test_name='test_value')
self.assertEqual(context['test_name'], 'test_value')
+ def test_object_at_custom_name_in_context_data(self):
+ # Checks 'pony' key presence in dict returned by get_context_date
+ test_view = views.CustomSingleObjectView()
+ test_view.context_object_name = 'pony'
+ context = test_view.get_context_data()
+ self.assertTrue(context['pony'] == test_view.object)
@mjtamlyn

mjtamlyn May 18, 2013

Member

Please use self.assertEqual

@sicarrots sicarrots Fixed #20234 and #20236 -- SingleObjectMixin fixes
Added object on SingleObjectMixin returned context,
some code clanup.
3eba8c7
Contributor

sicarrots commented May 18, 2013

I've squashed my commits into one with proper commit message.

Member

mjtamlyn commented May 19, 2013

Wonderful, good work. Thanks!

@mjtamlyn mjtamlyn added a commit that referenced this pull request May 19, 2013

@mjtamlyn mjtamlyn Merge pull request #1116 from elektrrrus/ticket_20234_20236
Ticket 20234 20236
c70ca48

@mjtamlyn mjtamlyn merged commit c70ca48 into django:master May 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment