All Questions
3,541
questions
0
votes
0
answers
29
views
Django Internationalization test error:Couldn't retrieve redirection page
I wrote a blog project in Django,in some pages i used loginrequierdmixin to make sure user is loged in but in test i got error
test:
def test_get_profile_unauthenticated(self):
response = ...
-1
votes
0
answers
28
views
FastAPI dependency is not getting overriden [SOLVED] [closed]
I'm trying to run some tests with pytest against the API but my dependency override is not working. The root app is in my 'main' file and the endpoints are in a 'routers' file. I also have a separate '...
0
votes
1
answer
30
views
How to test Amazon Athena queries
I have a rather complicated Athena query, which I would like to test on a local machine without connecting to Athena. I specified some mock data for testing purposes, and I was hoping that I could use ...
1
vote
0
answers
24
views
mocking out imported objects in Python
Lets say there is a module headache that defines an object that is then imported and used by code I want to test:
# defined in headache/__init__.py
problem = Problem()
then it's imported by Foo:
# ...
1
vote
2
answers
64
views
How to mock sqlalchemy's async session?
Code snippet
from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
engine = create_async_engine(url="")
session_maker = async_sessionmaker(engine)
How can I mock the ...
0
votes
0
answers
28
views
How to list all futures that are being polled inside specific event loop when running pytest?
I'm running multiple pytest tests.
I have 1 specific test case, which works fine when executed alone, but when large amount of previous tests are being executed, this particular test gets stuck when ...
1
vote
1
answer
24
views
Cannot mock the method in dependency module correctly in Python
Here is my project structure
|-- project
|-- util.py
|-- main.py
|-- tests
|-- test_main.py
In the main.py file I reference the function in util.py
from util import rename
def ...
1
vote
1
answer
132
views
Robot Framework is Automatically closing the browser
I am new to Robot and have this simple code from a tutorial. The code is supposed open chrome and visit the login page of this website. It does that, however, it closes the browser automatically. I've ...
0
votes
0
answers
40
views
Why python testing always import the file in another module implicitly
Current I have two files in the same folder, in the source file I import the dlt module
# File: pipeline.py
import dlt
Another is a test file which import nothing from the source file yet:
import ...
1
vote
1
answer
30
views
Django session in tests
everyone!
I can't figure out how the sessions work in Django.
I have a shop, an anonymous user's shopping cart is bound to session_key.
The session key is taken from the request object.
def ...
0
votes
0
answers
24
views
Why 'coverage' considers all of my class-based-views as tested?
I'm just learning django testing.
When I use 'Coverage' module to check which parts of my code is tested, it considers almost all of class-based-views as tested while I have commented out all of my ...
0
votes
1
answer
33
views
AssertionError while testing forms.py in Django
I tried to test forms.py in Django which has LeadForm class.
Here, is the models.py
class Lead(TimestampedModel):
"""leads for LIVE courses"""
course = models....
-1
votes
1
answer
27
views
Flask unit test failing due to FileNotFoundError for private key file [duplicate]
I'm trying to run unit tests on a Flask application that utilizes public and private keys for JWT token generation. However, when running my unit tests, I'm getting a FileNotFoundError indicating that ...
0
votes
0
answers
23
views
testing django oauth2_provider authentication endpoint
I need to test o/token endpoint of the oauth2_provider. I wrote the test in pytest. I think I considered every thing but I get invalid_client error.
The code:
factory:
class UserApplicationFactory(...
0
votes
0
answers
47
views
How to parse step definition code for projects using Cucumber?
I'm working on a project where I want to evaluate how Behavior Driven Development is being used. I want to extract Gherkin steps from .feature files and match the underlying step definition code. For ...