Esempio n. 1
0
 def test_authorized_admin_can_enter_admin_views(self):
     """
      Let's check if an smadmin user can enter everywhere
     """        
     testguy = Provider.objects.create(username="******", password="******")
     self.assertEqual(True, checkAdmin(testguy) )
     self.assertEqual(True, checkChannelAdmin(testguy) )
     self.assertEqual(True, checkCustomer(testguy) )
Esempio n. 2
0
 def test_customer_can_enter_only_customer_views(self):
     """
      Let's check if an customer user can enter customer views
     """                
     testguy = Customer.objects.create(username="******", password="******")        
     self.assertEqual(False, checkAdmin(testguy) )
     self.assertEqual(False, checkChannelAdmin(testguy) )
     self.assertEqual(True, checkCustomer(testguy) )
Esempio n. 3
0
 def test_normal_user_cant_enter_admin_views(self):
     """
      Let's check if an unauthorized user can't enter smadmin views
     """
     testguy = User.objects.create(username="******", password="******")
     self.assertEqual(False, checkAdmin(testguy) )
     self.assertEqual(False, checkChannelAdmin(testguy) )        
     self.assertEqual(False, checkCustomer(testguy) )