コード例 #1
0
 def test_access_to_resolution_page(self):
     """
     This function tests that the user can view the page that lists all of the proposed balance resolutions.
     :return:
     """
     request = self.factory.get('/transactions/resolution')
     request.user = self.user
     response = home(request)
     self.assertEqual(response.status_code, 200)
コード例 #2
0
 def test_access_to_forget_password_page(self):
     """
     This test checks that the user can access the forgotten password page.
     :return: Asserts that the HTTP response was successful.
     """
     request = self.factory.get('/forgotpassword')
     request.user = self.user
     response = home(request)
     self.assertEqual(response.status_code, 200)
コード例 #3
0
 def test_access_to_completed_page(self):
     """
     This function tests that the user can view the page that lists all of their completed transactions.
     :return:
     """
     request = self.factory.get('/transactions/completed')
     request.user = self.user
     response = home(request)
     self.assertEqual(response.status_code, 200)
コード例 #4
0
 def test_access_to_group_page(self):
     """
     This function tests that the user can view the page that lists their current groups.
     :return:
     """
     request = self.factory.get('/groups')
     request.user = self.user
     response = home(request)
     self.assertEqual(response.status_code, 200)
コード例 #5
0
 def test_access_to_login_page(self):
     """
     This test checks that the user can access the login page.
     :return: Asserts that the HTTP response was successful.
     """
     request = self.factory.get('/login')
     request.user = self.user
     response = home(request)
     self.assertEqual(response.status_code, 200)
コード例 #6
0
 def test_access_to_friends_page(self):
     """
     This test checks that the user can access their list of friends.
     :return:
     """
     request = self.factory.get('/users/friends/')
     request.user = self.user
     response = home(request)
     self.assertEqual(response.status_code, 200)
コード例 #7
0
 def test_access_to_profile_page(self):
     """
     This test checks that the user can access their own profile page.
     :return:
     """
     request = self.factory.get('/profile/')
     request.user = self.user
     response = home(request)
     self.assertEqual(response.status_code, 200)
コード例 #8
0
 def test_access_to_groups(self):
     """
     This function tests that the user can access all pages of their current groups.
     :return:
     """
     groups = self.user.groups.all()
     for g in groups:
         request = self.factory.get('/groups/' + str(g.id) + '/')
         response = home(request)
         self.assertEqual(response.status_cdo)
コード例 #9
0
 def test_access_to_transactions(self):
     """
     This function tests that the user can view all of the transactions in the application.
     :return:
     """
     ts = Transaction.objects.all()
     for t in ts:
         request = self.factory.get('/transactions/' + str(t.id) + '/')
         request.user = self.user
         response = home(request)
         self.assertEqual(response.status_code, 200)
コード例 #10
0
 def test_access_to_user_pages(self):
     """
     This test checks that the user can access the profile pages of all users.
     :return:
     """
     accounts = Account.objects.all()
     for a in accounts:
         request = self.factory.get('/users/' + str(a.user_id) + '/')
         request.user = self.user
         response = home(request)
         self.assertEqual(response.status_code, 200)
コード例 #11
0
 def test_access_to_events(self):
     """
     This function tests that the user can access all pages of the events in each of their groups.
     :return:
     """
     groups = self.user.groups.all()
     for g in groups:
         events = Event.objects.filter(group_id=g.id)
         for e in events:
             request = self.factory.get('/groups/' + str(g.id) +
                                        '/events/' + str(e.id) + '/')
             response = home(request)
             self.assertEqual(response.status_cdo)