title: 'module' object has no attribute 'test one'
body: <p>Why is my test script giving me this error? Here is my code:</p>
  <pre><code># fill_web_form_test.py
  
  # import statements
  import unittest
  import fill_web_form
  import sqlite3
  import sys
  
  form = 'test'
  form_name = 'test_form'
  
  if(len(sys.argv) &lt; 2):
         raise RuntimeError('invalid number of arguments, please enter at least one arguement to be \
                          test fill_web_form.py')
  for arg in sys.argv:
      if(not isinstance(arg, str)):
          raise RuntimeError('All arguments must be strings')
  # these test strings will be entered by the user as the first parameter
  # it will be submited to the webpage to test fill_web_form.py
  data = sys.argv[1:len(sys.argv)]
  print &quot;data = &quot; + ', '.join(data)
      
  class KnownValues(unittest.TestCase):
  
      def test_fill_form(self):
          
          # connect to sample database
          print 'connecting to database'
          conn = sqlite3.connect('FlaskApp\FlaskApp\sample.db')
          conn.text_factory = str
  
          # clear database table
          print &quot;clearing database&quot;
          cursor = conn.cursor()
          cursor.execute(&quot;DROP TABLE if exists test_table&quot;)
          cursor.execute(&quot;CREATE TABLE if not exists test_table(test_column)&quot;)
          conn.commit()
          
          # run function
          print &quot;running fill_web_form.py&quot;
          for data_entry in data:
              fill_web_form.fill_form(&quot;http://127.0.0.1:5000&quot;, form, form_name, data_entry)
  
          # get results of function from database
          print &quot;fetching results of fill_web_form.py&quot;
          cursor = conn.execute(&quot;SELECT * FROM test_table&quot;)
          result = cursor.fetchall()[0]
          print &quot;Database contains strings: &quot; + result
          expected = data
  
          # check for expected output
          print &quot;checking if output is correct&quot;
          self.assertEquals(expected, result)
  
  # Run tests
  
  if __name__ == '__main__':
      unittest.main()
  </code></pre>
  <p>Here is the code for fill_web_form.py, the script that it is testing</p>
  <pre><code># fill_web_form.py
  import mechanize
  
  
  def fill_form(url, form, form_name, data):
          print &quot;opening browser&quot;
          br = mechanize.Browser()
          print &quot;opening url...please wait&quot;
          br.open(url)
          print br.title()
          print &quot;selecting form&quot;
          br.select_form(name=form)
          print &quot;entering string:'&quot; + data +&quot;' into form&quot;
          br[form_name] = data
          print &quot;submitting form&quot;
          br.submit()
  </code></pre>
  <p>When I run <code>python fill_web_form_test.py &quot;testone&quot; &quot;testtwo&quot; &quot;testthree&quot;</code> in <code>cmd</code> i get this error:
  <a href="https://i.stack.imgur.com/E0KJJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E0KJJ.png" alt="enter image description here" /></a></p>
  <p>My test script is supposed to take in any number of strings and send to <code>fill_web_form.py</code> which will post them to a web form I have on my system at <code>127.0.0.1</code></p>
  <p>But I keep gettin this error <code>AttributeError: module has no attribute 'testone'</code>I don't get it, I wasn't trying to access a module with an attribute 'testone, I was just trying to pass that string to <code>fill_web_form.py</code></p>
  <p>Can anyone help me?</p>