Example #1
0
 def for_user(self, user):
     user_type = determine_user_type(user)
     if user_type is None:
         return None
     return UserType.objects.filter(user_type=user_type,
                                    is_active=True).first()
Example #2
0
 def for_user(self, user):
     user_type = determine_user_type(user)
     if user_type is None:
         return None
     return UserType.objects.filter(user_type=user_type,
                                    is_active=True).first()
Example #3
0
 def assert_user_type(self, expected, user):
     """Handle details of determining and checking user_type."""
     self.assertEqual(expected,
                      determine_user_type(user))
Example #4
0
 def assert_user_type(self, expected, user):
     """Handle details of determining and checking user_type."""
     self.assertEqual(expected, determine_user_type(user))