Пример #1
0
# -*- coding: utf-8 -*-
from plugin_messaging import Messaging
from gluon.tools import Auth
import unittest
import datetime

if request.function == 'test':
    db = DAL('sqlite:memory:')

### setup core objects #########################################################
auth = Auth(db)

messaging = Messaging(db)
messaging.settings.table_thread_name = 'plugin_messaging_thread'
messaging.settings.table_message_name = 'plugin_messaging_message'
messaging.settings.extra_fields = {
    'plugin_messaging_thread': 
        [Field('created_on', 'datetime', default=request.now)],
}

### define tables ##############################################################
auth.define_tables()
table_user = auth.settings.table_user

messaging.define_tables(str(table_user))
table_thread = messaging.settings.table_thread
table_message = messaging.settings.table_message

### populate records ###########################################################
num_users = 3
user_ids = {}
Пример #2
0
# -*- coding: utf-8 -*-
from plugin_messaging import Messaging
from gluon.tools import Auth
import unittest
import datetime

if request.function == 'test':
    db = DAL('sqlite:memory:')

### setup core objects #########################################################
auth = Auth(db)

messaging = Messaging(db)
messaging.settings.table_thread_name = 'plugin_messaging_thread'
messaging.settings.table_message_name = 'plugin_messaging_message'
messaging.settings.extra_fields = {
    'plugin_messaging_thread':
    [Field('created_on', 'datetime', default=request.now)],
}

### define tables ##############################################################
auth.define_tables()
table_user = auth.settings.table_user

messaging.define_tables(str(table_user))
table_thread = messaging.settings.table_thread
table_message = messaging.settings.table_message

### populate records ###########################################################
num_users = 3
user_ids = {}
Пример #3
0
# -*- coding: utf-8 -*-
from plugin_messaging import Messaging
from gluon.tools import Auth
import unittest

if request.function == 'test':
    db = DAL('sqlite:memory:')

### setup core objects #########################################################    
auth = Auth(db)
messaging = Messaging(db)
messaging.settings.table_message_thread_name = 'plugin_messaging_message_thread'
messaging.settings.table_message_name = 'plugin_messaging_message'
messaging.settings.extra_fields = {
    'plugin_messaging_message_thread': 
        [Field('created_on', 'datetime', default=request.now)],
}

### define tables ##############################################################
auth.define_tables()
table_user = auth.settings.table_user

messaging.define_tables(auth.settings.table_user_name)
table_message_thread = messaging.settings.table_message_thread
table_message = messaging.settings.table_message

### populate records ###########################################################
num_users = 3
user_ids = {}
for i in range(1, num_users+1):   
    email = '*****@*****.**' % i