separate builds for testing and flake8

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
speed up builds by caching apt

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
make this bastard work

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
do not run coveralls there

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
one more `||true`

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
Set travis to run tests in Polish.

RATIONALE: Spanish has twenty locales.  It takes a while to generate them.
           I replaced it by Polish which has just one.  (I could’ve chosen
           another language that is supported by us and has just one
           locale, but I chose mine for no reason at all.  I’m no patriot,
           don’t think this was the reason.)

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
save even more time

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
Optimize the test suite.

Changes include:

 * default tests locale is Polish instead of Spanish

   Rationale: see commit 049f59a.

              tl¹;dr: 1 vs 20 locales to generate, that’s all.

 * flake8 is running on its own build jobs.

   Rationale: we are now able to tell what passed and what didn’t at a
              glance.  We do not have to search through stuff to find out
              what (nosetests or flake8) failed.

 * Use the Travis apt cache, which will save us a few seconds here or
   there.

¹ This commit message is actually longer than the one in 049f59a.

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
copy #891 code to nikola.utils

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
resolve #891 — implement demoting headers

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
fix tests

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
actually fix tests

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
allow the compiler to be None

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
move the header demotion test from markdown to utils

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
flake8

[ci skip]

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
use a real fake compiler

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
missed an instance of the former setup in reST

Note that I am doing that ONLY because I want a single implementation
troughout the entire codebase, without using compiler-specific nonsense.

If we did not do this, we’d have to have “I can do it by myself” value
for the compiler.demote_headers variable (there is no AlreadyDone
singleton in Python, is there?  Lying with False does not count), and
we’d have to query the site config in the reST plugin.  Not worth the
hassle.

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
flake8

[ci skip]

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
Make the tests pass and header demotion work correctly!

Finding the solution took me forever.  The lxml.etree.ParseError was not
shown by the test suite.  I also couldn’t see it  on  manual  demo  site
builds before (it’s now obvious to me why this happened, I did not  have
an empty file that is created by the test suite)  I  had  to  *manually*
run the test case (as in, copy-paste  stuff  from  the  test_integration
module into a .py file and run it) to get the *PROPER*  traceback.   And
then everything became fairly obvious.  But I could’ve been  done  EIGHT
commits and  FIVE  hours  ago.   But  no,  tracebacks  cannot  be  sane.

/rant

cc @ralsina — you may want to look into it and tell me why that happens.

(just in case GitHub goes weird due to the mess I made: close #891)

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
reword slightly