From 9ee9a7b588e1ecac903c4b8019ac500c94edab72 Mon Sep 17 00:00:00 2001 From: qw3rty Date: Wed, 26 May 2010 17:39:49 +0000 Subject: [PATCH 1/1] adding an example test for the user module. the fixture portion of this maybe not be loading the test data. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@333 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/models/tests/__init__.py | 0 forum/models/tests/fixtures/users | 33 +++++++++++ forum/models/tests/test_user.py | 96 +++++++++++++++++++++++++++++++ 3 files changed, 129 insertions(+) create mode 100644 forum/models/tests/__init__.py create mode 100644 forum/models/tests/fixtures/users create mode 100644 forum/models/tests/test_user.py diff --git a/forum/models/tests/__init__.py b/forum/models/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/forum/models/tests/fixtures/users b/forum/models/tests/fixtures/users new file mode 100644 index 0000000..7f8a95a --- /dev/null +++ b/forum/models/tests/fixtures/users @@ -0,0 +1,33 @@ + + + + super + Super + User + super@example.com + sha1$995a3$6011485ea3834267d719b4c801409b8b1ddd0158 + True + True + True + 2007-05-30 13:20:10 + 2007-05-30 13:20:10 + + + + True + True + 10 + 1 + 1 + 1 + 2007-05-30 13:20:10 + Super User + www.superuser.com + Raleigh + 2007-05-30 13:20:10 + I am a super user + + 1 + 1 + + \ No newline at end of file diff --git a/forum/models/tests/test_user.py b/forum/models/tests/test_user.py new file mode 100644 index 0000000..0d9a93e --- /dev/null +++ b/forum/models/tests/test_user.py @@ -0,0 +1,96 @@ +from django.test import TestCase +from forum.models.user import * + +class UserTest(TestCase): + fixtures = ['users.xml'] + + def setUp(self): + self.client.login(username='super', password='secret') + + + + def tearDown(self): + self.client.logout() + + def test_gravatar(self): + + self.assert_(True) + + def test_save(self): + self.assert_(True) + + def test_get_absolute_url(self): + self.assert_(True) + + def test_get_messages(self): + self.assert_(True) + + def test_delete_messages(self): + self.assert_(True) + + def test_get_profile_url(self): + self.assert_(True) + + def test_get_profile_link(self): + self.assert_(True) + + def test_get_visible_answers(self): + self.assert_(True) + + def test_get_vote_count_today(self): + self.assert_(True) + + def test_get_reputation_by_upvoted_today(self): + self.assert_(True) + + def test_get_flagged_items_count_today(self): + self.assert_(True) + + def test_can_view_deleted_post(self): + self.assert_(True) + + def test_can_vote_up(self): + self.assert_(True) + + def test_can_vote_down(self): + self.assert_(True) + + def test_can_flag_offensive(self): + self.assert_(True) + + def test_can_view_offensive_flags(self): + self.assert_(True) + + def test_can_comment(self): + self.assert_(True) + + def test_can_like_comment(self): + self.assert_(True) + + def test_can_edit_comment(self): + self.assert_(True) + + def test_can_delete_comment(self): + self.assert_(True) + + def test_can_accept_answer(self): + self.assert_(True) + + def test_can_edit_post(self): + self.assert_(True) + + def test_can_retag_questions(self): + self.assert_(True) + + def test_can_close_question(self): + self.assert_(True) + + def test_can_reopen_question(self): + self.assert_(True) + + def test_can_delete_post(self): + self.assert_(True) + + def test_can_upload_files(self): + self.assert_(True) + -- 2.39.5