<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    On 07/05/2012 23:37, John Wong wrote:
    <blockquote
cite="mid:CACCLA54zK=Q3GsVHKZNhcYfung-4TqwBtRn=9_uBHjyQMzWmfA@mail.gmail.com"
      type="cite">Hi,<br>
      <br>
      I am not a testing expert, but my development falls in this domain
      as well since my django site is only used as a web interface. I
      don't even use django model except for registration (which has to
      authorized through LDAP) and django session (the default stuff).<br>
      <br>
      &gt;Is it worth running the tests of these externally-maintained
      apps when<br>
      &gt; testing the site as a whole? <br>
      Isn't this a system test rather than unit-test? Yes. You want to
      find out whether they work or not, right?<br>
      <br>
      <br>
      &gt;it'sarguable that someone else would be keeping an eye on the
      unit tests, so<br>
      &gt; there's no need for me to run them.<br>
      <br>
      Isn't the whole point of unittest really testing the "correctness"
      of an individual unit (which usually means a method / a function)
      that actually DOES something (rather than just initialize some
      data, or print, etc).<br>
      If you don't run integration test on these external apps as a
      whole, you can't assure the quality of the system as a whole. The
      idea would be "scope". Test the scope / objective of the service
      (referring to the purpose of using this particular app in your
      main site) within the main site, and test the untested purposes
      within the app level (which could be itself a django project)....<br>
      <br>
      A situation would be, say My-Site (your main Django project) has
      an upload feature, which runs on a different Django PROJECT
      (another django site) called My Upload. You will need to perform
      integration tests on both projects. If the inetgration is so soft
      that you literally take in the file object and pass it to your
      upload django service, you really just need a few simple, quick
      integration tests on the main site to test upload(relevant to your
      main site). If the upload service ITSELF does many things, test
      those "untested" one within the upload service django project.<br>
      <br>
      John<br>
      <br>
      <br>
      <div class="gmail_quote">On Mon, May 7, 2012 at 4:04 PM, Alexander
        Dutton <span dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:lists@alexdutton.co.uk" target="_blank">lists@alexdutton.co.uk</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          Hi all,<br>
          <br>
          Best practice question. I maintain a Django-based site that
          comprises<br>
          various externally-maintained apps and some apps that are
          site-specific.<br>
          Should I be viewing these as solely unit<br>
          tests, or as integration tests?<br>
          <br>
          Most of the externally-maintained apps (e.g.
          object_permissions) come<br>
          with their own settings files and are invoked like:<br>
          <br>
          $ django-admin test
          --settings=object_permissions.tests.settings<br>
          <br>
          These settings often declare a specific ROOT_URLCONF and other
          settings<br>
          (e.g. TESTING = True). Just including the app in
          INSTALLED_APPS is<br>
          liable to result in test failures. I imagine I'd have to patch<br>
          ROOT_URLCONF for each app, which means a custom test runner
          and general<br>
          ugliness. It also doesn't suffice for integration testing, and
          it's<br>
          arguable that someone else would be keeping an eye on the unit
          tests, so<br>
          there's no need for me to run them.<br>
          <br>
          Any thoughts?<br>
          <br>
          Yours,<br>
          <br>
          Alex<br>
          <br>
          _______________________________________________<br>
          testing-in-python mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
          <a moz-do-not-send="true"
            href="http://lists.idyll.org/listinfo/testing-in-python"
            target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
        </blockquote>
      </div>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
testing-in-python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a>
<a class="moz-txt-link-freetext" href="http://lists.idyll.org/listinfo/testing-in-python">http://lists.idyll.org/listinfo/testing-in-python</a>
</pre>
    </blockquote>
    <br>
    <br>
    Personally, I think no, it is not worth running the tests for
    3rd-party Django apps. Certainly not for pre-commit tests (which I
    will go to enourmous lengths to make run as fast as possible.) I
    could be persuaded that it's worth running them in continuous
    integration, because the cost of a slightly longer build is less
    significant there, but only provided running them is very easy,
    fast, and requires no nannying.<br>
    <br>
    You do want to be sure that these tests are actually passing in your
    project, but on the other hand, you aren't changing the code that
    they test, so the chance of them breaking is relatively low. I think
    it's a question of judgement rather than absolute right or wrong,
    but personally I've never had any benefit (i.e. useful failures)
    from running these tests. So I'd rather speed up the build by
    skipping them.<br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Jonathan Hartley    <a class="moz-txt-link-abbreviated" href="mailto:tartley@tartley.com">tartley@tartley.com</a>    <a class="moz-txt-link-freetext" href="http://tartley.com">http://tartley.com</a>
Made of meat.       +44 7737 062 225       twitter/skype: tartley

</pre>
  </body>
</html>