Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added more tests; minor documentation tweak

git-svn-id: https://django-voting.googlecode.com/svn/trunk@51 662f01ad-f42a-0410-a340-718c64ddaef4
  • Loading branch information...
commit decaa841791a5754d6308b1146053ea0e449566e 1 parent 4df7a03
Jonathan Buchanan insin authored

Showing 2 changed files with 16 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 README.txt
  2. +13 0 tests/tests.py
5 README.txt
@@ -22,8 +22,9 @@ If you've already downloaded, rename the directory before installing.
22 22
23 23 To install django-voting, do the following:
24 24
25   - 1. Put ``'voting'`` in your ``INSTALLED_APPS`` setting.
26   - 2. Run the command ``manage.py syncdb``.
  25 + 1. Put the ``voting`` folder somewhere on your Python path.
  26 + 2. Put ``'voting'`` in your ``INSTALLED_APPS`` setting.
  27 + 3. Run the command ``manage.py syncdb``.
27 28
28 29 The ``syncdb`` command creates the necessary database tables and
29 30 creates permission objects for all installed apps that need them.
13 tests/tests.py
@@ -67,4 +67,17 @@
67 67 >>> Vote.objects.get_for_user_in_bulk([], users[0])
68 68 {}
69 69
  70 +>>> for user in users[1:]:
  71 +... Vote.objects.record_vote(i2, user, +1)
  72 +... Vote.objects.record_vote(i3, user, +1)
  73 +... Vote.objects.record_vote(i4, user, +1)
  74 +>>> list(Vote.objects.get_top(Item))
  75 +[(<Item: test2>, 4), (<Item: test4>, 3), (<Item: test3>, 2)]
  76 +>>> for user in users[1:]:
  77 +... Vote.objects.record_vote(i2, user, -1)
  78 +... Vote.objects.record_vote(i3, user, -1)
  79 +... Vote.objects.record_vote(i4, user, -1)
  80 +>>> list(Vote.objects.get_bottom(Item))
  81 +[(<Item: test3>, -4), (<Item: test4>, -3), (<Item: test2>, -2)]
  82 +
70 83 """

0 comments on commit decaa84

Please sign in to comment.
Something went wrong with that request. Please try again.