Files
offline-db/frontend_test3.py
25beb6ede8 feat: Implement comprehensive input validation (XSS, MIME, URLs) (#330)
- Added `bio` field to User model and migrations
- Created `UserProfileUpdateSerializer` with RegexValidator (XSS) and Bleach (HTML sanitization)
- Updated `ExternalSourceSerializer` to require `https://` or `magnet:` schemes
- Replaced insecure extension checking with true MIME validation via `python-magic` in serializers (Subtitles, Images, Banners)
- Fixed NextUI floating label overlap bug on magnet link input with `labelPlacement="outside"` and a placeholder.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Senpai-YoloBot <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-22 13:05:46 +00:00

26 lines
761 B
Python

from playwright.sync_api import Page, expect, sync_playwright
def test_admin_upload(page: Page):
page.goto("http://localhost:3000/admin/upload")
page.wait_for_timeout(2000)
page.get_by_role("tab", name="Magnet Link").click()
page.wait_for_timeout(500)
input_field = page.locator('input').nth(1)
input_field.fill("invalid-link")
page.wait_for_timeout(500)
page.screenshot(path="/home/jules/verification/admin_upload.png")
if __name__ == "__main__":
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
try:
test_admin_upload(page)
except Exception as e:
print(f"Error: {e}")
finally:
browser.close()