def setUp(self):
        user_details = {
            'username': 'test_user',
            'password': 'test_pass',
            'email': 'test_user@demo.com'
        }
        self.user = User.objects.create_user(**user_details)
        self.user.generate_key()
        self.org = Organization.objects.create()
        OrganizationUser.objects.create(user=self.user, organization=self.org)

        cb = CanonicalBuilding(active=True)
        cb.save()
        b = SEEDFactory.building_snapshot(canonical_building=cb,
                                          property_name='ADMIN BUILDING',
                                          address_line_1='100 Admin St')
        cb.canonical_snapshot = b
        cb.save()
        b.super_organization = self.org
        b.save()
        self.building = b

        self.api_url = reverse_lazy('seed:get_building')
        self.params = {
            'building_id': cb.pk,
            'organization_id': self.org.pk,
        }
        self.auth_string = '%s:%s' % (self.user.username, self.user.api_key)
dataset/ETHPy150Open buildingenergy/buildingenergy-platform/seed/tests/test_api.py/ApiAuthenticationTests.setUp/original