Ejemplo n.º 1
0
def createGroup(name, created_by):
    """Creates a group
        Args:
                name - String - Name of the group
                created_by  -String  - Usename of the group creator
        Return:
                None
        Rasies:

        """
    Group.createGroup(name, created_by)
 def setUp(self):
     """Setup new databse for test methods
        Populate the database with at least one record per table for testing
     """
     self.db_fd, project.app.config['DATABASE'] = tempfile.mkstemp()
     project.app.testing = True
     self.app = project.app.test_client()
     with project.app.app_context():
         db.Database().create_tables()
         user.createUser('adminTest', 'tcg1134', '', '')
         user.createUser('adminTest2', 'gct2334', '', '')
         Group.createGroup('TestGroup', 'adminTest2')
         topic.insertTopic('TestTopic', 'adminTest2', '1')
         post.insertPost(1, 'adminTest2', 'TestPost', 'Some random text')
         subscription.addToSub(1, 1)
         notification.sendNotif("post", 1)
         Votes.upvote(1, 1)