]> git.openstreetmap.org Git - osqa.git/commitdiff
adding an example test for the user module. the fixture portion of this maybe not...
authorqw3rty <qw3rty@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 26 May 2010 17:39:49 +0000 (17:39 +0000)
committerqw3rty <qw3rty@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 26 May 2010 17:39:49 +0000 (17:39 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@333 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/models/tests/__init__.py [new file with mode: 0644]
forum/models/tests/fixtures/users [new file with mode: 0644]
forum/models/tests/test_user.py [new file with mode: 0644]

diff --git a/forum/models/tests/__init__.py b/forum/models/tests/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/forum/models/tests/fixtures/users b/forum/models/tests/fixtures/users
new file mode 100644 (file)
index 0000000..7f8a95a
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<django-objects version="1.0">
+    <object pk="100" model="forum.models.user">
+        <field type="CharField" name="username">super</field>
+        <field type="CharField" name="first_name">Super</field>
+        <field type="CharField" name="last_name">User</field>
+        <field type="CharField" name="email">super@example.com</field>
+        <field type="CharField" name="password">sha1$995a3$6011485ea3834267d719b4c801409b8b1ddd0158</field>
+        <field type="BooleanField" name="is_staff">True</field>
+        <field type="BooleanField" name="is_active">True</field>
+        <field type="BooleanField" name="is_superuser">True</field>
+        <field type="DateTimeField" name="last_login">2007-05-30 13:20:10</field>
+        <field type="DateTimeField" name="date_joined">2007-05-30 13:20:10</field>
+        <field to="auth.group" name="groups" rel="ManyToManyRel"></field>
+        <field to="auth.permission" name="user_permissions" rel="ManyToManyRel"></field>
+
+        <field type="BooleanField" name="is_approved">True</field>
+        <field type="BooleanField" name="email_isvalid">True</field>
+        <field type="PositiveIntegerField" name="reputation">10</field>
+        <field type="PositiveIntegerField" name="gold">1</field>
+        <field type="PositiveIntegerField" name="silver">1</field>
+        <field type="PositiveIntegerField" name="bronze">1</field>
+        <field type="DateTimeField" name="last_seen">2007-05-30 13:20:10</field>
+        <field type="CharField" name="real_name">Super User</field>
+        <field type="URLField" name="website">www.superuser.com</field>
+        <field type="CharField" name="location">Raleigh</field>
+        <field type="DateField" name="date_of_birth">2007-05-30 13:20:10</field>
+        <field type="TextField" name="about">I am a super user</field>
+        <field type="ManyToManyField" name="subscriptions"></field>
+        <field type="DenormalizedField" name="vote_up_count">1</field>
+        <field type="DenormalizedField" name="vote_down_count">1</field>
+    </object>
+</django-objects>
\ 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 (file)
index 0000000..0d9a93e
--- /dev/null
@@ -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)
+