本文整理汇总了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)
示例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')
示例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)
示例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)
示例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')
示例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, [])