-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<div class="owindow" style="width: 60%"> | ||
<div class="title modal-header"> | ||
User info <\/div> | ||
<div class="content modal-body"> | ||
<img style="float:left; padding: 2px 8px; background-color: #FFF;" src="https:\/\/www.wikidot.com\/avatar.php?userid=4598089&timestamp=1710039304" alt="" \/> | ||
<h1>aismallard<\/h1> | ||
|
||
<table class="table"> | ||
<tr> | ||
<td class="active"> | ||
<b>Gender<\/b> | ||
<\/td> | ||
<td> | ||
female <\/td> | ||
<\/tr> | ||
<tr> | ||
<td class="active"> | ||
<b>Website<\/b> | ||
<\/td> | ||
<td> | ||
<a href="https:\/\/scpwiki.com\/aismallard">https:\/\/scpwiki.com\/aismallard<\/a> | ||
<\/td> | ||
|
||
<tr> | ||
<td class="active"> | ||
<b>Wikidot.com User since:<\/b> | ||
<\/td> | ||
<td> | ||
<span class="odate time_1536706055 format_%25e%20%25b%20%25Y%2C%20%25H%3A%25M%20%28%25O%20ago%29">11 Sep 2018 22:47<\/span> | ||
<\/td> | ||
<\/tr> | ||
|
||
|
||
<tr> | ||
<td class="active"> | ||
<b>Account type<\/b> | ||
<\/td> | ||
<td> | ||
free | ||
<\/td> | ||
<\/tr> | ||
|
||
<tr> | ||
<td class="active"> | ||
<b>Karma level<\/b> | ||
<\/td> | ||
<td> | ||
guru <img src="\/\/www.wikidot.com\/userkarma.php?u=4598089&onlyKarma=true"\/> | ||
(<a href="http:\/\/www.wikidot.com\/doc:karma" target="_blank">what is this?<\/a>)<br\/> | ||
<\/td> | ||
<\/tr> | ||
|
||
<tr> | ||
<td class="active"> | ||
<b>Member of this Site: since<\/b> | ||
<\/td> | ||
<td> | ||
<span class="odate time_1536730624 format_%25e%20%25b%20%25Y%2C%20%25H%3A%25M%20%28%25O%20ago%29">12 Sep 2018 05:37<\/span> | ||
<\/td> | ||
<\/tr> | ||
<tr> | ||
<td class="active"> | ||
<b>Role in this Site<\/b> | ||
<\/td> | ||
<td> | ||
Site Administrator <\/td> | ||
<\/tr> | ||
|
||
<\/table> | ||
|
||
<div style="margin-top: 10px"> | ||
<div style="float:right"> | ||
<a href="javascript:;" class="btn btn-danger btn-small btn-sm" onclick="WIKIDOT.modules.UserInfoWinModule.listeners.flagUser(event, 4598089)">Flag user as abusive<\/a> | ||
<!--<span id="user-abuse-report-button">?<\/span>--> | ||
<\/div> | ||
<a href="http:\/\/www.wikidot.com\/user:info\/aismallard" class="btn btn-primary">Profile page<\/a> | ||
<a href="http:\/\/www.wikidot.com\/account\/messages#\/new\/4598089" class="btn btn-primary">Write private message<\/a> | ||
<a href="javascript:;" onclick="WIKIDOT.modules.UserInfoWinModule.listeners.addContact(event,4598089)" class="btn btn-primary">Add to contacts<\/a> | ||
<\/div> | ||
<\/div> | ||
<div class="button-bar modal-footer"> | ||
<a href="javascript:;" class="btn btn-danger" onclick="OZONE.dialog.cleanAll()">Close window<\/a> | ||
<\/div> | ||
|
||
<div id="user-abuse-report-button-hovertip" style="display: none"> | ||
Notify administrators\/moderators about abusive user. <\/div> | ||
<\/div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import unittest | ||
from unittest.mock import patch | ||
|
||
import requests | ||
|
||
from yellowstone.config import Config | ||
from yellowstone.wikidot import Wikidot | ||
|
||
from .helpers import FakeResponse | ||
|
||
|
||
class TestWikidotClass(unittest.TestCase): | ||
def setUp(self): | ||
self.config = Config( | ||
s3_bucket="test", | ||
site_slugs=["test", "test-tls"], | ||
sites_use_tls=["test-tls"], | ||
sites_use_admin_members=[], | ||
always_fetch_site=True, | ||
) | ||
self.wikidot = Wikidot(self.config, username="test", api_key="test") | ||
|
||
def test_ajax_module_connector(self): | ||
http_response = FakeResponse.from_file("user_info_win") | ||
with patch.object(requests, "post", return_value=http_response): | ||
html = self.wikidot.ajax_module_connector( | ||
"www", | ||
"users/UserInfoWinModule", | ||
{"user_id": 4598089}, | ||
) | ||
self.assertEqual(html, http_response.data["body"]) | ||
|
||
def test_site_url(self): | ||
ajax_url = self.wikidot.site_url("test") | ||
self.assertEqual(ajax_url, "http://test.wikidot.com") | ||
|
||
ajax_url = self.wikidot.site_url("test-tls") | ||
self.assertEqual(ajax_url, "https://test-tls.wikidot.com") | ||
|
||
def test_ajax_url(self): | ||
ajax_url = self.wikidot.ajax_module_url("test") | ||
self.assertEqual(ajax_url, "http://test.wikidot.com/ajax-module-connector.php") | ||
|
||
ajax_url = self.wikidot.ajax_module_url("test-tls") | ||
self.assertEqual( | ||
ajax_url, "https://test-tls.wikidot.com/ajax-module-connector.php" | ||
) | ||
|
||
def test_generate_token7(self): | ||
token7 = self.wikidot.generate_token7() | ||
self.assertEqual(len(token7), 32) |