Package expedient :: Package clearinghouse :: Module utils
[hide private]
[frames] | no frames]

Module utils

source code

Created on Nov 9, 2010


Author: jnaous

Functions [hide private]
 
post_message_to_current_user(msg_text, sender=None, msg_type='announcement')
Post a message to the user whose request is being processed.
source code
 
add_dummy_agg_to_test_settings(test)
Adds the dummy aggregate test models to the installed apps of the test.
source code
 
create_test_users(test) source code
 
give_test_permissions(test) source code
 
create_test_aggregates(test) source code
 
create_test_project(test) source code
 
add_test_project_member(test) source code
 
add_test_aggregate_to_project(test) source code
 
create_test_slice(test) source code
 
add_test_aggregate_to_slice(test) source code
 
add_resources_to_test_slice(test) source code
 
start_test_slice(test)
Create a test setup with aggregates, users, project, and started slice.
source code
Variables [hide private]
  __package__ = 'expedient.clearinghouse'
Function Details [hide private]

post_message_to_current_user(msg_text, sender=None, msg_type='announcement')

source code 

Post a message to the user whose request is being processed.

This function depends on the threadlocals middleware to find the current user, so it must be installed.

Parameters:
  • msg_text (str) - The message to post for the user.
  • sender (django.contrib.auth.models.User) - The message sender. Defaults to None.
  • msg_type (str limited to one of DatedMessage.TYPE_*) - The type of the message. Defaults to DatedMessage.TYPE_ANNOUNCE.

add_dummy_agg_to_test_settings(test)

source code 

Adds the dummy aggregate test models to the installed apps of the test.

test must be a child of expedient.common.tests.manager.SettingsTestCase.

start_test_slice(test)

source code 

Create a test setup with aggregates, users, project, and started slice.

Creates two users, test.u1 and test.u2. Gives test.u1 permission to create aggregates. Creates two dummy aggregates with resources using u1.

Gives u2 permission to create project, creates project with u2, add u1 as researcher member, creates a slice, add all dummy resources to slice, and starts it.

test must be a child of expedient.common.tests.manager.SettingsTestCase.