Exemplo n.º 1
0
 def add_message(self, **kwargs):
     post_data = {
         'uid': self.uid,
         'url': kwargs.get('url', 'http://87437483'),
         'refer': 'http://232323',
         'user_id': kwargs.get('user_id', self.userid),
         'timein': '1545104860000',
         'timeOut': '1545104861000',
         'timeon': '1',
     }
     MLog.add(post_data)
Exemplo n.º 2
0
    def test_add(self):
        post_data = {
            'uid': self.uid,
            'url': 'http://',
            'refer': 'http://',
            'user_id': '',
            'timein': '1545104860000',
            'timeOut': '1545104861000',
            'timeon': '1',
        }

        MLog.add(post_data)
        assert True
Exemplo n.º 3
0
    def add(self, **kwargs):
        '''
        in infor.
        '''

        post_data = {}

        for key in self.request.arguments:
            post_data[key] = self.get_arguments(key)[0]

        MLog.add(post_data)
        kwargs.pop('uid', None)  # delete `uid` if exists in kwargs

        self.redirect('/log/')
Exemplo n.º 4
0
    def test_add(self):
        a = MLog.get_by_uid(self.uid)

        assert a == None
        post_data = {
            'uid': self.uid,
            'url': 'http://54243243',
            'refer': 'http://344343',
            'user_id': self.userid,
            'timein': '1545104860000',
            'timeOut': '1545104861000',
            'timeon': '1',
        }

        a = MLog.add(post_data)
        assert a
        self.tearDown()
Exemplo n.º 5
0
    def test_add(self):
        a = MLog.query_pager_by_user(self.userid)
        assert a.count() == 0
        post_data = {
            'uid': self.uid,
            'url': 'http://54243243',
            'refer': 'http://344343',
            'user_id': self.userid,
            'timein': '1545104860000',
            'timeOut': '1545104861000',
            'timeon': '1',
        }

        a = MLog.add(post_data)
        self.uid = a
        self.tearDown()
        assert a