本文整理匯總了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, [])