def test_get_projects_for_user_one(self):
     p = Project(title="title", description="desc")
     p.save()
     
     u = UserAssociation(user = self.__user, project=p)
     u.save()
     
     self.assertEqual( models.project_api.get_projects_for_user(self.__user.id).count(), 1)    
Пример #2
0
 def test_can_user_access_project_can(self):
     p = Project(title="title", description="desc")
     p.save()
     u = UserAssociation(user=self.__user, project=p)
     u.save()
     self.assertEqual(
         models.project_api.can_user_access_project(self.__user.id, p.id),
         True)
Пример #3
0
 def test_can_user_access_project_can(self):
     p = Project(title="title", description="desc")
     p.save()
     u = UserAssociation(user=self.__user, project=p)
     u.save()
     self.assertEqual(
         models.project_api.can_user_access_project(
             self.__user.id,
             p.id),
         True)
Пример #4
0
    def test_get_projects_for_user_one(self):
        p = Project(title="title", description="desc")
        p.save()

        u = UserAssociation(user=self.__user, project=p)
        u.save()

        self.assertEqual(
            models.project_api.get_projects_for_user(self.__user.id).count(),
            1)
Пример #5
0
 def __addUserAsOwner(self):
     ua = UserAssociation(project=self.__project,
                          user=self.__user,
                          role=user_association.ROLE_OWNER)
     ua.save()
Пример #6
0
 def __addUserAsDev(self):
     ua = UserAssociation(project=self.__project,
                          user=self.__user,
                          role=user_association.ROLE_DEVELOPER)
     ua.save()
Пример #7
0
 def __addUserAsClient(self):
     ua = UserAssociation(project=self.__project,
                          user=self.__user,
                          role=user_association.ROLE_CLIENT)
     ua.save()
Пример #8
0
 def __addUserAsOwner(self):
     ua = UserAssociation(
         project=self.__project,
         user=self.__user,
         role=user_association.ROLE_OWNER)
     ua.save()
Пример #9
0
 def __addUserAsDev(self):
     ua = UserAssociation(
         project=self.__project,
         user=self.__user,
         role=user_association.ROLE_DEVELOPER)
     ua.save()
Пример #10
0
 def __addUserAsClient(self):
     ua = UserAssociation(
         project=self.__project,
         user=self.__user,
         role=user_association.ROLE_CLIENT)
     ua.save()