Test performance: Mock out pypandoc.convert_text
when testing export views
#1092
Labels
pypandoc.convert_text
when testing export views
#1092
After having failed with my previous attempt to reduce testing time, I present this idea:
Let's mock out
pypandoc.convert_text
when testing export views.Through pytest parametrization there are a couple of tests, that run 100+ times.
For example these tests run
num_times = u * e
(number of users * number of export formats).The export view tests actually run
pypandoc.convert_text
every time. But only the status code of the response is checked. The exported text file, e.g. pdf is never checked. Therefore I suggest mockingpypandoc.convert_text
. This way each test can still test the response status code, but the real pypandoc does not need to convert the data. This will save time given the large number of tests doing this.I suggest checking the export view separately once, maybe using the request factory and to actually check the returned data. Which exported rdmo model would be best for this?
What do you think?
The text was updated successfully, but these errors were encountered: