Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8384465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:24:45+00:00 2026-06-09T17:24:45+00:00

Actually I don’t see what I am doing wrong here but I guess it

  • 0

Actually I don’t see what I am doing wrong here but I guess it is a very simple and basic problem:

Module 1 called Widget17_Sorter.py:

class Widget17_Sorter(object):

    def get_data_from_database(self, database_name, user, password, host ):
        ...do stuff here...

Module 2 called Test_Widget17_Sorter.py (actually a unit test)

import Widget17_Sorter

class Test(unittest.TestCase):

    ...do some other stuff here...

    def test_get_data_from_database(self):
        sorter = Widget17_Sorter.Widget17_Sorter()
        raw_data = sorter.get_data_from_database( self.database_name, 
                                    self.user, self.password, self.host )

When executing the test I get the following error message:

ERROR: test_get_data_from_database (__main__.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "TestWidget17_Sorter.py", line 50, in test_get_data_from_database
    raw_data = sorter.get_data_from_database( self.database_name,
AttributeError: 'Widget17_Sorter' object has no attribute 'get_data_from_database'

Why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:24:46+00:00Added an answer on June 9, 2026 at 5:24 pm

    Try importing this way:

    from Widget17_Sorter import Widget17_Sorter
    ...
    my_widget = Widget17_Sorter(...)
    my_widget.get_data_from_database(...)
    

    …and put both scripts in the same folder…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to solve the following problem using constraints but i actually don't
There are similar questions, but none answers what I really need. I actually don't
First: apologies for the question title, I don't actually know what the problem is
I don't know if variadic is actually the right word, but I'm talking about
I don't know if it's actually possible to do, but I have a text
I've got a queue (actually 3 different queues but I don't believe that will
I haven't actually done this yet, and maybe I don't need to, but it
I hate to give the question this heading but I actually don't know whats
I actually don't even know how to call this :P, but... I have one
Somehow my master and my origin/master branch have diverged. I actually don't want them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.