當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。