Exemplo n.º 1
0
 def test_that_baristas_url_with_companyID_with_user_returns_200(self):
     request = self.factory.get('/baristas/1')
     request.session = self.session
     request.session['user'] = self.user
     request.user = self.user
     response = companyBaristas(request)
     self.assertEquals(response.status_code, 200)
Exemplo n.º 2
0
 def test_that_baristas_url_with_companyID_with_no_user_returns_403(self):
     request = self.factory.get('/baristas/1')
     request.session = self.session
     request.session['user'] = self.anon_user
     request.user = self.anon_user
     try:
         response = companyBaristas(request)
         self.assertEquals('Anonymous User', 'Accessed baristas/1 url')
     except (PermissionDenied):
         self.assertEquals('Permission was denied', 'Permission was denied')
Exemplo n.º 3
0
    def test_that_barista_user_viewing_baristas_shows_correct_feed_order_and_returns_200(self):
        request = self.factory.get('/baristas/1')
        request.session = self.session
        request.session['user'] = self.barista2
        request.user = self.barista2
        response = companyBaristas(request)
        self.assertEquals(response.status_code, 200)
        
# Incomplete Test
    # def test_that_register_url_returns_200(self):
    #     request = self.factory.get('/register/')
    #     request.user = self.user
    #     self.assertEquals(response.status_code, 200)