title: Python/Django Comparing two float values leads to TypeError: Can't convert 'int' object to str implicitly
body: <p>I'm experiencing the following strange behavior when I run my functional tests with Selenium.</p>
  
  <p>I have a JavaScript program that populates an input field within Selenium. I check for the correct values in that input field (see below). The test runs as a class of <code>StaticLiveServerTestCase</code>.</p>
  
  <pre><code>    # Values to compare against
      lng= 8.63259210000001
  
      # Get the value attribute of the field
      lng_field = float(self.browser.find_element_by_id('id_lng').get_attribute('value'))
  
      # if i use pdb.set_trace() at this position i can do 
      # all the following operations without any problems
  
      # When i do any of the following i get an error message
      mydiff = abs(lng_field-lng)
      # or
      lng_field==lng
  </code></pre>
  
  <p>For any other operation where there is a comparison or computation involving <code>lng</code> and <code>lng_field</code>, I get the following error:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):
      File "...", line XXX, in mytest
        mydiff = abs(lng_field-lng)
    TypeError: Can't convert 'int' object to str implicitly</p>
  </blockquote>
  
  <p>However, everything works within the console when I use <code>pdb.set_trace()</code>(every operation works perfectly fine).</p>
  
  <p>Even when I convert both values to strings and only use the first 5 characters (<code>mystring[:5]</code>) within the string the code line with the comparison leads to the error stated above.</p>
  
  <p>The comparison is not even failing, there is just no comparison during runtime, but everything works fine in the console.</p>
  
  <p>I also tried using <code>copy.deepcopy()</code> of the values before I compare them, but still I get the same error when I run the functional tests.</p>
  
  <ul>
  <li><strong>Python Version:</strong> 3.4.5 </li>
  <li><strong>Django:</strong> 1.10.5 </li>
  <li><strong>IDE:</strong> PyDev </li>
  <li><strong>OS:</strong> Windows 10</li>
  </ul>
  
  <p>Any ideas?</p>