Commit Graph

16 Commits

Author SHA1 Message Date
Isaac Bythewood
a4f3adc2df Updated requirements and other items in preps of new pinry version 2013-09-22 03:33:50 +00:00
Krzysztof Klimonda
7db42bb075 Generate thumbnails when image is being saved
Too lax unique constraints for Thumbnail coped with "on demand" thumbnail
generation may leave database in inconsistent state where two thumbnail for
the same size are saved. We should be able to prevent that from happening
by generating all thumbnails when we save the image. Should fix #24, but
I can't figure out a way to actually test it.
2013-04-16 00:30:43 +02:00
Krzysztof Klimonda
c0bf9d992e Make sure that users can't impersonate each other when creating pins
We weren't checking if the Pin submitter is the logged user which made it possible
to pass any submitter to the Pin resource create call. Fix it, and make the submitter
optional.
2013-04-05 19:34:31 +02:00
Krzysztof Klimonda
3b10868832 Open binary files in the binary mode
Make sure that we are using binary mode to read binary files like images, this Fixes #20
2013-04-05 19:10:17 +02:00
Krzysztof Klimonda
e71452c68f Use a relative path for the test image
It's part of the issue #20 (weird path on Windows). Django File class used
a full file path which resulted in path like C:\Example\pinry\static\C:\... which
is obviously invalid.
2013-03-27 21:07:22 +01:00
Krzysztof Klimonda
494f7fbd8c Fix test by mocking requests.get function 2013-03-19 15:41:55 +01:00
Krzysztof Klimonda
4580a700ab Use media/ for files created during tests. Fixes #2 2013-03-05 01:58:11 -08:00
Krzysztof Klimonda
26b6805b6f Replace screenshot.png with logo.png in tests 2013-03-05 01:32:57 -08:00
Krzysztof Klimonda
10c9b35700 Even though not used, import models for Factory Boy 2013-03-05 01:28:39 -08:00
Isaac Bythewood
b63544905e Remove screenshot that is outdated and no longer needed, add full AGPL license and update api.py to use logo image instead of screenshot for testing 2013-03-05 01:53:46 +00:00
Krzysztof Klimonda
26f9c76988 Don't use FACTORY_FOR when not needed 2013-03-04 15:33:09 -08:00
Krzysztof Klimonda
7a85f1b514 Use post_generation hooks to populate models with some data
Factory Boy provides us with a better way of populating complicated
fields (like M2M relations) than overriding _prepare class method,
so we should be using them.
2013-03-04 14:58:54 -08:00
Krzysztof Klimonda
ef818b7f82 Rewrite tests to use a Model mocker library
There has been issues when running a full test suite (for pinry and
the entire Django stack), and test fixtures are hard to maintain anyway,
so rewrite tests to use a Model mocker library (Factory Boy) to populate
database.
2013-03-04 12:06:00 -08:00
Krzysztof Klimonda
856d2d1e87 Allow filtering pins over submitter.username 2013-03-03 14:51:19 -08:00
Krzysztof Klimonda
cae9fa96be Write some more tests for all code 2013-03-03 10:09:33 -08:00
Krzysztof Klimonda
03e05906f8 Reorganize core package tests into modules 2013-03-03 09:10:42 -08:00