Skip to content

Commit

Permalink
Fix typo in __unicode__ of ApiAccess model.
Browse files Browse the repository at this point in the history
Thanks to @exister for the report.
  • Loading branch information
bohde committed Sep 26, 2012
1 parent 876c054 commit 19c680a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tastypie/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ApiAccess(models.Model):
accessed = models.PositiveIntegerField()

def __unicode__(self):
return u"%s @ %s" % (self.identifer, self.accessed)
return u"%s @ %s" % (self.identifier, self.accessed)

def save(self, *args, **kwargs):
self.accessed = int(time.time())
Expand Down
7 changes: 7 additions & 0 deletions tests/core/tests/throttle.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,10 @@ def test_throttling(self):
self.assertEqual(len(cache.get('daniel_accesses')), 0)
self.assertEqual(ApiAccess.objects.count(), 7)
self.assertEqual(ApiAccess.objects.filter(identifier='daniel').count(), 4)


class ModelTestCase(TestCase):
def test_unicode(self):
access = ApiAccess(identifier="testing", accessed=0)
self.assertEqual(unicode(access), 'testing @ 0')

0 comments on commit 19c680a

Please sign in to comment.