aboutsummaryrefslogtreecommitdiffstats
path: root/app_test.py (follow)
Commit message (Collapse)AuthorAgeLines
* remove vagrantGravatar Christopher Baklid2018-05-23-0/+0
|
* Privacy/Usability updates (#75)Gravatar Gareth Coles2018-05-20-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use less intrusive oauth scopes, add login redirect method * Remove debugging prints, add missing __init__ * Work towards new privacy policy * Fix judging state icons on code jam management page * Jammer profile retraction and punishments based on jam status * Linting * [Jams] Deny profile saving for users < 13 years, and finish removal page * Fix tests * Clean up and address Volcyy's review * Add proper login redirection to require_roles decorator * Fix template is_staff() and add staff link to navigation * Address lemon's review * Linting * Privacy page formatting * Privacy page formatting
* Tests directory (#73)Gravatar Christopher Baklid2018-05-20-519/+0
| | | moves all tests into a testing directory and splits the tests into separate files
* Snake cog (#71)Gravatar Leon Sandøy2018-05-19-14/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Tables that are initialized with JSON files in the table_init folder will now sync properly if the JSON file is changed after initialization. Any lines that are either added or removed will be updated whenever site is rebooted. * Initial API endpoint for snake_quiz * reverting database.py * I WILL KILL YOU * Added the snake_fact API endpoint * Moving snake tables to the new migrations system * Set up initial data for all new tables, added table objects, wrote endpoints, and wrote tests for the new endpoints. * Removing the snake_movies endpoint. That idea didn't pan out. * Added an endpoint for getting special snake cases * broken json * Fixing the initial data slightly, better picture of bob. * Changing JSON indentation to be 4 spaces consistently in all initial_data, to address Aperture's review. Also changing all the endpoints to have correct namespacing, addressing gdude's review. * Fixing tests to point to new API endpoints
* Gunicorn is super picky about when_ready arityGravatar Gareth Coles2018-05-14-1/+1
|
* account for the FLASK_DEBUG env not being there before running testsGravatar Christopher Baklid2018-05-08-1/+4
|
* account for debug mode in unit testingGravatar Christopher Baklid2018-05-08-0/+1
|
* fix tests in travisGravatar Christopher Baklid2018-05-08-4/+4
|
* fix testsGravatar Christopher Baklid2018-05-08-98/+99
|
* Remove broken unit tests until Inver can look at themGravatar Gareth Coles2018-05-08-84/+84
|
* Fix testsGravatar Gareth Coles2018-05-08-3/+5
|
* Fix testsGravatar Gareth Coles2018-05-08-2/+3
|
* [#1eeu1] Hiphopify (#54)Gravatar Leon Sandøy2018-04-20-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Changed the dev-mode logic to be the same as prod for creating new tables if they don't exist. Also added a new feature where a table can be initialized with data if you create a JSON file in the pysite/database/table_init/ folder and fill it with a list of dicts where each dict represents a row in your table. Included a hiphoppers json so that I can actually test if it works in production. It will only init the table if the table is empty. * Not sure if this will solve it, but I think so. * Renamed the tables and primary keys, and alphabetized the dict. Now complies with the gdudes holy wishes. * Almost done with the initial build for this. Implemented GET and DELETE, in order to finish POST I need to expand the database.py interface class. * Alphabetized database convenience wrappers. * Fixed a few typehints and added the sample convenience wrapper to the database class. * Finishing up the POST method and adding a duration parser to the utils folder so we can handle strings like 2w3d and turn them into a timestamp. * Fixed API blueprint loading, which was broken by the setup method in the DBMixIn. I'd forgotten to remove the check for table_name attribute. Also adde some logging and got the DELETE route working. * Added timezone-sensitivity to the duration parser so it will work with rethink. renamed the json and fixed some bugs in the hiphopify API. * Added a utility to test if rdb timestamps are expired, and only returning data from the GET calls if it isn't expired. * changed some log wording * Setting up Lil Joseph as default image. Adding some rappers to the list. * Adding a bunch of logging * These tests no longer apply. New tests must be written in the long run, removing them for now. * Addressing review comments left by Volcyy * Fixed misleading comment.
* Add wiki audit logs (#52)Gravatar Joseph2018-04-17-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add wiki audit logs * Flake8 issues * Forgot to remove debug prints * Removed print but forgot to remove `.text` * Futile attempt to increase coverage * Reading up on API docs asks us to send User-Agent with our info in it * Add tests for wiki * Well played, Travis * Nothing in my local env is working on travis lol * Why does it appear it can't decide between 200 & 302 :thinking: * Flake8 * Post route * Same issue with local env working differently from Travis env * Add page to show page is being edited * Lock page when it is being edited * Add JS to keep refreshing lock on article * Add compare route to render diff * Add revision table to database * Add revision storage * Add revision list route * JS for Revision list radio buttons * Add revision comparison template * Add revision list template * flak8 my ass * [Unit Tests] New unit tests for history routes :sparkles: * Does this fix things? * Address gdude's reviews * Noticed a bug in the diff generation route which meant that empty posts could potentially error * Flake 8 * Audit logs were logging after change, meaning it was comparing after & after, which didn't work * Change table name * Remove whitespace from line to fix flake8 issue * Address reviews * Git hook made me do something wrong, apologies * Switch from werkzeug redirect to flask one * Address Apertures reviews
* I guess we were testing for log level handling. Removed these tests. We ↵Gravatar Leon Sandøy2018-04-16-11/+0
| | | | always want TRACE level logging, we can filter in datadog.
* Fix unit testsGravatar Gareth Coles2018-04-10-2/+2
|
* oops, forgot to update the testGravatar Leon Sandøy2018-04-10-3/+3
|
* Fix build for realGravatar Gareth Coles2018-04-08-0/+3
|
* Easier debugging and optimised importsGravatar Gareth Coles2018-04-08-2/+0
| | | | Simply set FLASK_DEBUG=1 in your env to skip OAuth checks
* Fix testsGravatar Gareth Coles2018-04-07-0/+2
|
* Fix testsGravatar Gareth Coles2018-04-01-0/+2
|
* Fix test for nowGravatar Gareth Coles2018-04-01-2/+3
| | | | Needs revisiting, I don't know how to do this correctly
* Accept username/discriminator from the bot and remove it from oauthGravatar Gareth Coles2018-03-30-2/+2
|
* Fix testsGravatar Gareth Coles2018-03-30-2/+2
|
* Fix OAuth unit testGravatar Gareth Coles2018-03-29-1/+1
|
* Oauth (#45)Gravatar Nate the great2018-03-29-13/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Creating a OAUTH login for the site. We still need to have a way to fill in credentials however. Signed-off-by: Zwork101 <[email protected]> * How ya like me now Travis? Signed-off-by: Zwork101 <[email protected]> * Fix slight error in database insertion * Revert "Fix slight error in database insertion" (wrong branch) This reverts commit 9ac6cbb * Don't have snekchek working, but I'll try again. Signed-off-by: Zwork101 <[email protected]> * Please enter the commit message for your changes. Lines starting * Adding Oauth2 login to site. * Add prefix * Add prefix * This never happened * Flipping Travis I still can't get snekchek to work locally. * Added a whole bunch of stuff, ready to be used. Signed-off-by: Zwork101 <[email protected]> * Making sessions more secure, and future safe. Signed-off-by: Zwork101 <[email protected]> * Adding some quick stuff Signed-off-by: Zwork101 <[email protected]> * Appease the flake8 gods Signed-off-by: Zwork101 <[email protected]> * Appease the flake8 gods Signed-off-by: Zwork101 <[email protected]> * Whoops Signed-off-by: Zwork101 <[email protected]> * Add comments, fix user_data function. Signed-off-by: Zwork101 <[email protected]> * Whooops, forgot to flake :/ Signed-off-by: Zwork101 <[email protected]> * Make it look nicer, thanks Aperture. Signed-off-by: Zwork101 <[email protected]> * Fixing login issues and added button * Add a OauthMixin to allow for easy data access. Clean stuff up. Signed-off-by: Zwork101 <[email protected]> * Fix a test, and use self.assertEqual rather then self.assertEquals! Signed-off-by: Zwork101 <[email protected]> * Please don't ask how that happened. Signed-off-by: Zwork101 <[email protected]> * Added some tests, moved a bunch of stuff around. Mainly cleaned stuff up. Signed-off-by: Zwork101 <[email protected]> * Add a ton of tests, try to please the coverall gods :D, moved some code into a function for testing. Signed-off-by: Zwork101 <[email protected]> * Just some stupid stuff I missed. Signed-off-by: Zwork101 <[email protected]> * Fix an issue with the test, and add docs Signed-off-by: Zwork101 <[email protected]> * Remove pointless function. (join_user) Signed-off-by: Zwork101 <[email protected]> * Fix test consistency
* CountdownGravatar JoeBanks132018-03-21-5/+0
|
* Added a Code Jam Countdown (#1eevq) (#43)Gravatar Sam Wedgwood2018-03-21-0/+5
| | | | | | | | | | | | * added countdown * updated jam dates * added test * flake8 * flake8 (i did it on wrong file)
* API for tags (#34)Gravatar Leon Sandøy2018-03-06-19/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Help page and misc improvements Committing so I can go home >:| * [WIP] - API improvements for the tag features. Not completed. * renaming tag.py to tags.py and refactoring the nomenclature of docs to tags * fixed error message in tags, cleaning up app_test.py * tests for the tags feature * ignoring jsonify returns cause coverall can't handle them * Catch-all error view for the API blueprint * cleaning up APIErrorView a little * bringing coverage for tags.py to 100% * how did this get in here? * how did this get in here? ROUND 2 * Removing the 503 database error handling. It's not in use and we should probably rethink that whole custom error handling system anyway. * Converting the tags file to use the @api_params decorator instead of validating manually. Tested with bot staging.
* Fix user API testGravatar Gareth Coles2018-03-04-6/+6
|
* Info pages #13xan #13xak (#36)Gravatar Gareth Coles2018-03-04-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Info pages and templates * Info pages and templates * Info pages and templates * Update navigation and fix up HTML * Navigation HTML spacing for readability * Fix error views not using `self.render()` * `render()` method should accept Any for context values * Change header linking CSS to a dedicated class * Rules page * Basic resources page setup * Fix headers for new CSS class * Resource categories and initial resource data * Add link to JSON file on GH - won't work until the branch is merged * Remove info overview page and redirect info root url to resources * Flake8 * Add some tests * Line lengths
* Add error messages (#30)Gravatar Joseph2018-02-28-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add error messages Signed-off-by: JoeBanks13 <[email protected]> * Remove un-used keyword arg from 404 * Assert for status code instead of full content * PEP8 * test lint * please coverage * oh * Exclude websockets.py from coverage * Move code output into terminal * Switch typewriter href protocol * Add tests for websockets.py * Abort previous commit, coveralls did not let coverage go down * Add more pauses and request => response * move css and js out, add typewriter JS to our own repo & add method for appending text in bulk. * Enable REPL on 4XX and change error descriptions * commas * /error path
* Fix unit testGravatar Gareth Coles2018-02-27-3/+3
|
* Help page #z62n (#25)Gravatar Gareth Coles2018-02-26-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | * Help page and misc improvements Committing so I can go home >:| * Changes for @lmn * Rephrase first paragraph * Rephrase questions so they aren't all about discord.py * Remove _every single header_ on the help page from the nav * Unit test the help route * Small styling fixes * Add page-specific classes to body element * Clean up section padding * IndexView -> HelpView * Remove unnecessary path in test
* brings coverage to 90% (#24)Gravatar Christopher Baklid2018-02-26-19/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * brings coverage to 75% * satisfy flake8 * missing docstring added * one more test * artificially inflate coverage because python acts strange * testing decorators * fixed instantiation of test route * straggling newlines from debugging code * remove debug comments * restructure tests into logical class separations. more exlusions. more tests * testing websocket echo tests * added missing comment * convert single quotes to double quotes to satisfy docstrings
* adds initial unit testing (#22)Gravatar Christopher Baklid2018-02-20-0/+96
* Adds Unit Testing * Adds coveralls coverage badge