stats/tests.py::TestStats::test_posts_from_yesterday_are_updated

First seen 1 year, 5 months ago in commit 1cd3a pushed by Anže Pečar

Last 100 Runs
Pass % 100.0%
p50 duration 0.1059s
p95 duration 0.1140s

13 runs 13 passed in the last 30 days

Run 8 months, 1 week ago
Status PASS
Commit

Add zeal to catch N+1 errors

Commit c3a90 pushed by Anže Pečar
Run 8 months, 1 week ago
Status PASS
Commit

Try out django-watchfiles

Commit 62213 pushed by Anže Pečar
Run 8 months, 1 week ago
Status PASS
Commit

Merge 701148bc89bf6544b52973e9eecca5ab77b9b8d7 into 7d542951492bdbfb90426b71b1bb774ac7db42c3

Commit 8ea4e pushed by pre-commit-ci[bot]
Run 8 months, 1 week ago
Status PASS
Commit

Better titles everywhere!

Commit 7d542 pushed by Anže Pečar
Run 8 months, 1 week ago
Status PASS
Commit

Improve page titles

Commit fa985 pushed by Anže Pečar
Run 8 months, 1 week ago
Status PASS
Commit

Speed up last_status_at_cached

Commit a8439 pushed by Anže Pečar
Run 8 months, 1 week ago
Status PASS
Commit

Remove template profiler

Commit db40c pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Merge pull request #73 from anze3db/pre-commit-ci-update-config

Commit f9629 pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Sitemap fixes

Commit df332 pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Switch to conference_slug so that the traces look more informative in Sentry

Commit 81eb0 pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Fix follow button

Commit 46e06 pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Unlimited spans for the next 14 days

Commit e6a34 pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Add a bit of caching on conference page

Commit e2f45 pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Remove sampling

Commit 08b09 pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Fix n+1 query for logged in users

Commit 5aa0c pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Fix tests

Commit de6bd pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status FAIL
Commit

Fix daily stats

Commit 8dea1 pushed by Anže Pečar
Repr
self = <stats.tests.TestStats testMethod=test_posts_from_yesterday_are_updated>

    def test_posts_from_yesterday_are_updated(self):
        today = timezone.now()
        yesterday = today - dt.timedelta(days=1)
    
        yesterday_stats = Daily.objects.create(
            date=yesterday.date(),
            total_accounts=2,
            python_accounts=1,
            javascript_accounts=1,
            rust_accounts=0,
            ruby_accounts=0,
            golang_accounts=0,
            java_accounts=0,
            kotlin_accounts=0,
            scala_accounts=0,
            swift_accounts=0,
            csharp_accounts=0,
            fsharp_accounts=0,
            dotnet_accounts=0,
            cpp_accounts=0,
            linux_accounts=0,
            haskell_accounts=0,
            ocaml_accounts=0,
            nix_accounts=0,
            opensource_accounts=0,
            php_accounts=0,
        )
        account = Account.objects.create(
            account_id="2",
            instance="fosstodon.org",
            username="fosstest",
            acct="fosstest",
            display_name="Test Foss",
            locked=False,
            bot=False,
            discoverable=True,
            group=False,
            created_at="2021-01-01T00:00:00.000000+00:00",
            last_status_at="2021-01-01T00:00:00.000000+00:00",
            last_sync_at="2021-01-01T00:00:00.000000+00:00",
            followers_count=0,
            following_count=0,
            statuses_count=0,
            note="",
            url="https://fosstodon.org/@fosstest",
            avatar="https://fosstodon.org/@fosstest/avatar",
            avatar_static="https://fosstodon.org/@fosstest/avatar",
            header="https://fosstodon.org/@fosstest/header",
            header_static="https://fosstodon.org/@fosstest/header",
            emojis=[],
            roles=[],
            fields=[],
        )
        AccountLookup.objects.create(account=account, language="python")
        Post.objects.create(
            account=account,
            post_id="0",
            url="https://fosstodon.org/@fosstest/1",
            created_at=yesterday.isoformat(),
            content="Hello, world!",
            reblog=False,
            sensitive=False,
            spoiler_text="",
            visibility="public",
            language="python",
            emojis=[],
            replies_count=0,
            reblogs_count=0,
            favourites_count=0,
            mentions=[],
            tags=[],
        )
        Post.objects.create(
            account=account,
            post_id="1",
            url="https://fosstodon.org/@fosstest/1",
            created_at=today.isoformat(),
            content="Hello, world!",
            reblog=False,
            sensitive=False,
            spoiler_text="",
            visibility="public",
            language="python",
            replies_count=0,
            reblogs_count=0,
            favourites_count=0,
            emojis=[],
            mentions=[],
            tags=[],
        )
        store_daily_stats()
    
        # make sure this doesn't change
        yesterday_stats.refresh_from_db()
        self.assertEqual(yesterday_stats.total_posts, 0)
        self.assertEqual(yesterday_stats.python_posts, 0)
        self.assertEqual(yesterday_stats.total_accounts, 2)
    
        today_stats = Daily.objects.get(date=today.date())
        self.assertEqual(today_stats.total_posts, 2)
>       self.assertEqual(today_stats.python_posts, 2)
E       AssertionError: 0 != 2

stats/tests.py:162: AssertionError
Run 8 months, 2 weeks ago
Status PASS
Commit

Fix java showing javascript accounts

Commit 39f19 pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Commit changes

Commit a870d pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Increase traces and spans to 50% for a bit

Commit eb6fa pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Cleanup urls

Commit 11beb pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Add profiles

Commit 404e7 pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Inline follow button html instead of using an inclusion tab

Commit 7bf98 pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Inline follow button html instead of using an inclusion tab

Commit c909e pushed by Anže Pečar
Run 8 months, 2 weeks ago
Status PASS
Commit

Merge aee8515f47858a9c1ca17600fb29a162b7ec6be7 into 0cd3c4616f3dd891cded43f7604bf01d31096d7c

Commit da6e0 pushed by pre-commit-ci[bot]