当前位置: 首页>>代码示例>>Python>>正文


Python ActivityLog.log方法代码示例

本文整理汇总了Python中devhub.models.ActivityLog.log方法的典型用法代码示例。如果您正苦于以下问题:Python ActivityLog.log方法的具体用法?Python ActivityLog.log怎么用?Python ActivityLog.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在devhub.models.ActivityLog的用法示例。


在下文中一共展示了ActivityLog.log方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_json_failboat

# 需要导入模块: from devhub.models import ActivityLog [as 别名]
# 或者: from devhub.models.ActivityLog import log [as 别名]
 def test_json_failboat(self):
     request = self.request
     a = Addon.objects.get()
     ActivityLog.log(request, amo.LOG['CREATE_ADDON'], a)
     entry = ActivityLog.objects.get()
     entry._arguments = 'failboat?'
     entry.save()
     eq_(entry.arguments, None)
开发者ID:ozten,项目名称:zamboni,代码行数:10,代码来源:test_models.py

示例2: test_basic

# 需要导入模块: from devhub.models import ActivityLog [as 别名]
# 或者: from devhub.models.ActivityLog import log [as 别名]
 def test_basic(self):
     request = self.request
     a = Addon.objects.get()
     ActivityLog.log(request, amo.LOG['CREATE_ADDON'], a)
     entries = ActivityLog.objects.for_addon(a)
     eq_(len(entries), 1)
     eq_(entries[0].arguments[0], a)
     eq_(unicode(entries[0]),
         'Joe CamelCase created addon Delicious Bookmarks')
开发者ID:ozten,项目名称:zamboni,代码行数:11,代码来源:test_models.py

示例3: test_user_log_as_argument

# 需要导入模块: from devhub.models import ActivityLog [as 别名]
# 或者: from devhub.models.ActivityLog import log [as 别名]
 def test_user_log_as_argument(self):
     """
     Tests that a user that has something done to them gets into the user
     log.
     """
     request = self.request
     u = UserProfile(username='Marlboro Manatee')
     u.save()
     ActivityLog.log(request, amo.LOG['ADD_USER_WITH_ROLE'],
             (u, 'developer', Addon.objects.get()))
     entries = ActivityLog.objects.for_user(request.amo_user)
     eq_(len(entries), 1)
     entries = ActivityLog.objects.for_user(u)
     eq_(len(entries), 1)
开发者ID:ozten,项目名称:zamboni,代码行数:16,代码来源:test_models.py

示例4: test_user_log

# 需要导入模块: from devhub.models import ActivityLog [as 别名]
# 或者: from devhub.models.ActivityLog import log [as 别名]
 def test_user_log(self):
     request = self.request
     ActivityLog.log(request, amo.LOG['CUSTOM_TEXT'], 'hi there')
     entries = ActivityLog.objects.for_user(request.amo_user)
     eq_(len(entries), 1)
开发者ID:ozten,项目名称:zamboni,代码行数:7,代码来源:test_models.py

示例5: test_output

# 需要导入模块: from devhub.models import ActivityLog [as 别名]
# 或者: from devhub.models.ActivityLog import log [as 别名]
 def test_output(self):
     request = self.request
     ActivityLog.log(request, amo.LOG['CUSTOM_TEXT'], 'hi there')
     entry = ActivityLog.objects.get()
     eq_(unicode(entry), 'hi there')
开发者ID:ozten,项目名称:zamboni,代码行数:7,代码来源:test_models.py

示例6: test_no_arguments

# 需要导入模块: from devhub.models import ActivityLog [as 别名]
# 或者: from devhub.models.ActivityLog import log [as 别名]
 def test_no_arguments(self):
     request = self.request
     ActivityLog.log(request, amo.LOG['CUSTOM_HTML'])
     entry = ActivityLog.objects.get()
     eq_(entry.arguments, [])
开发者ID:ozten,项目名称:zamboni,代码行数:7,代码来源:test_models.py


注:本文中的devhub.models.ActivityLog.log方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。