move all lineup exports into dropdown
This commit is contained in:
@@ -8,9 +8,6 @@
|
|||||||
<h6 class="text-muted card-subtitle text-nowrap">{{ event.data.start_date|date:"D, F j, Y g:i A" }}</h6>
|
<h6 class="text-muted card-subtitle text-nowrap">{{ event.data.start_date|date:"D, F j, Y g:i A" }}</h6>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
|
||||||
<button class="btn btn-primary btn-sm py-0 m-1" onclick="importFromClipboard(this)" type="button"><i class="bi bi-arrow-90deg-down"></i></i><i class="bi bi-file-spreadsheet"></i> </button>
|
|
||||||
</div>
|
|
||||||
<div class="col text-end d-inline">
|
<div class="col text-end d-inline">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
@@ -30,22 +27,20 @@
|
|||||||
<i class="bi bi-file-spreadsheet"></i> Sheet format to Clipboard
|
<i class="bi bi-file-spreadsheet"></i> Sheet format to Clipboard
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="Submit" class="dropdown-item" formaction="{% url 'teamsnap_submit_lineup' team_id=event.data.team_id event_id=event.data.id %}" form="form-lineup-{{ event.data.id }}" id="submit-lineup-teamsnap-{{ event.data.id }}">
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
TeamSnap
|
||||||
|
</button>
|
||||||
|
{% if request.user.gamechanger_account %}
|
||||||
|
<button type="Submit" class="dropdown-item" formaction="{% url 'gamechanger_lineup_submit' %}" form="form-lineup-{{ event.data.id }}" id="submit-lineup-gamechanger-{{ event.data.id }}">
|
||||||
|
<i class="bi bi-arrow-right"></i>
|
||||||
|
GameChanger
|
||||||
|
</button>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<button type="Submit" class="btn btn-teamsnap btn-sm py-0 m-1" formaction="{% url 'teamsnap_submit_lineup' team_id=event.data.team_id event_id=event.data.id %}" form="form-lineup-{{ event.data.id }}" id="submit-lineup-teamsnap-{{ event.data.id }}">
|
|
||||||
<i class="bi bi-arrow-right"></i>
|
|
||||||
TeamSnap
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
{% if request.user.gamechanger_account %}
|
|
||||||
<button type="Submit" class="btn btn-gamechanger btn-sm py-0 m-1 text-nowrap" formaction="{% url 'gamechanger_lineup_submit' %}" form="form-lineup-{{ event.data.id }}" id="submit-lineup-gamechanger-{{ event.data.id }}">
|
|
||||||
<i class="bi bi-arrow-right"></i>
|
|
||||||
GameChanger
|
|
||||||
</button>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1 +1,73 @@
|
|||||||
# Create your tests here.
|
import vcr
|
||||||
|
from django.conf import settings
|
||||||
|
from django.contrib.auth import (
|
||||||
|
BACKEND_SESSION_KEY,
|
||||||
|
HASH_SESSION_KEY,
|
||||||
|
SESSION_KEY,
|
||||||
|
get_user_model,
|
||||||
|
)
|
||||||
|
from django.contrib.sessions.backends.db import SessionStore
|
||||||
|
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
|
||||||
|
from selenium import webdriver
|
||||||
|
|
||||||
|
|
||||||
|
def create_session_cookie():
|
||||||
|
|
||||||
|
# First, create a new test user
|
||||||
|
user = get_user_model()
|
||||||
|
# user.objects.create_user(username=username, password=password)
|
||||||
|
user = get_user_model().objects.get(pk=2)
|
||||||
|
|
||||||
|
# Then create the authenticated session using the new user credentials
|
||||||
|
session = SessionStore()
|
||||||
|
session[SESSION_KEY] = user.pk
|
||||||
|
session[BACKEND_SESSION_KEY] = settings.AUTHENTICATION_BACKENDS[0]
|
||||||
|
session[HASH_SESSION_KEY] = user.get_session_auth_hash()
|
||||||
|
session.save()
|
||||||
|
|
||||||
|
# Finally, create the cookie dictionary
|
||||||
|
cookie = {
|
||||||
|
"name": settings.SESSION_COOKIE_NAME,
|
||||||
|
"value": session.session_key,
|
||||||
|
"secure": False,
|
||||||
|
"path": "/",
|
||||||
|
}
|
||||||
|
return cookie
|
||||||
|
|
||||||
|
|
||||||
|
class MySeleniumTests(StaticLiveServerTestCase):
|
||||||
|
fixtures = ["benchcoach/fixtures/dump.json"]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
cls.port = 8000
|
||||||
|
super().setUpClass()
|
||||||
|
cls.selenium = webdriver.Chrome("/opt/homebrew/bin/chromedriver")
|
||||||
|
cls.selenium.implicitly_wait(10)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def tearDownClass(cls):
|
||||||
|
cls.selenium.quit()
|
||||||
|
super().tearDownClass()
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
session_cookie = create_session_cookie()
|
||||||
|
self.selenium.get("{}{}".format(self.live_server_url, "/"))
|
||||||
|
self.selenium.add_cookie(session_cookie)
|
||||||
|
self.selenium.refresh()
|
||||||
|
pass
|
||||||
|
|
||||||
|
@vcr.use_cassette(
|
||||||
|
"teamsnap/lineup/fixtures/test.yaml",
|
||||||
|
ignore_localhost=True,
|
||||||
|
# record_mode="new_episodes",
|
||||||
|
decode_compressed_response=True,
|
||||||
|
allow_playback_repeats=True,
|
||||||
|
)
|
||||||
|
def test_login(self):
|
||||||
|
self.selenium.get(
|
||||||
|
"{url}/{team_id}/event/{event_ids}/edit_lineup/".format(
|
||||||
|
url=self.live_server_url, team_id=6882652, event_ids=266446202
|
||||||
|
)
|
||||||
|
)
|
||||||
|
breakpoint()
|
||||||
|
|||||||
Reference in New Issue
Block a user