Skip to content

Commit

Permalink
Fix subscriber's get_object_display
Browse files Browse the repository at this point in the history
Closes-Bug: #1287751

Change-Id: I84b36b98e51a19645e1bc47af2a205aec4cbbd2c
  • Loading branch information
sir-sigurd committed Mar 6, 2014
1 parent ca8eb96 commit 0d6403a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wildcard/dashboards/project/subscribers/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,6 @@ def _domains(self):

def get_object_id(self, datum):
return datum.uuid

def get_object_display(self, datum):
return datum.username
7 changes: 7 additions & 0 deletions wildcard/dashboards/project/subscribers/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from wildcard import api
from wildcard.dashboards.project.subscribers import forms
from wildcard.dashboards.project.subscribers import tables
from wildcard.test import helpers as test


Expand Down Expand Up @@ -176,6 +177,12 @@ def test_disable_subscriber(self):

self.assertRedirectsNoFollow(res, INDEX_URL)

def test_object_display(self):
subscriber = self.subscribers.get(uuid="1")
table = tables.SubscribersTable(self.request, [subscriber])
object_display = table.get_object_display(subscriber)
self.assertEquals(object_display, subscriber.username)


class TextInputWithGenerator(test.TestCase):

Expand Down

0 comments on commit 0d6403a

Please sign in to comment.